Radish alpha
H
rad:z3QDZAW2FAfuLvihrhiyDC9fAD8G9
HardenedBSD Package Manager
Radicle
Git
Merge pull request #434 from smortex/warn-invalid-commands
Baptiste Daroussin committed 13 years ago
commit e84520ce7388c3770c854b2a3deeb8cc0e4a8fc3
parent 716ffe7
1 file changed +5 -3
modified pkg/main.c
@@ -230,6 +230,7 @@ main(int argc, char **argv)
	int ret = EX_OK;
	const char *buf = NULL;
	bool b, plugins_enabled = false;
+
	bool plugin_found = false;
	bool show_commands = false;
	bool activation_test = false;
	struct pkg_config_kv *kv = NULL;
@@ -482,23 +483,24 @@ main(int argc, char **argv)

	if (command == NULL) {
		/* Check if a plugin provides the requested command */
+
		ret = EPKG_FATAL;
		if (plugins_enabled) {
			STAILQ_FOREACH(c, &plugins, next) {
-
				ret = EPKG_FATAL;
				if (strcmp(c->name, argv[0]) == 0) {
+
					plugin_found = true;
					ret = c->exec(argc, argv);
					break;
				}
			}
		}
		
-
		if (ret != EPKG_OK)
+
		if (!plugin_found)
			usage(conffile);
		
		pkg_plugins_shutdown();
		pkg_shutdown();

-
		return (ret); /* Not reached but makes scanbuild happy */
+
		return (ret);
	}

	if (ambiguous <= 1) {