From: root Date: Tue, 5 Jul 2016 17:06:07 +0000 (-0700) Subject: Enhanced error reporting for invalid commands and/or extensions. List reason why... X-Git-Tag: v0.9~26^2 X-Git-Url: https://www.infradead.org/git/?a=commitdiff_plain;h=2c418a20ee6706e27a8af432c5b94186c840454c;p=users%2Fsagi%2Fnvme-cli.git Enhanced error reporting for invalid commands and/or extensions. List reason why command line failed before displaying the usage message --- diff --git a/plugin.c b/plugin.c index 7b83f254..dd971bf0 100644 --- a/plugin.c +++ b/plugin.c @@ -141,8 +141,10 @@ int handle_plugin(int argc, char **argv, struct plugin *plugin) } /* Check extensions only if this is running the built-in plugin */ - if (plugin->name) + if (plugin->name) { + printf("ERROR: Invalid sub-command '%s' for plugin %s\n", str, plugin->name); return -1; + } extension = plugin->next; while (extension) { @@ -159,5 +161,6 @@ int handle_plugin(int argc, char **argv, struct plugin *plugin) } extension = extension->next; } + printf("ERROR: Invalid sub-command '%s'\n", str); return -1; }