For historical reasons, we allow the user to write their command line
executing "vendor" plugin "command" as one of two ways:
nvme vendor command
And
nvme vendor-command
This was conflicting if a hierarchy of vendor additions exists, like
"vendor-oem".
So, this patch fixes that by first searching the entire builtin vendor
plugins before searching for matching substrings.
Signed-off-by: Keith Busch <keith.busch@intel.com>
while (extension) {
if (!strcmp(str, extension->name))
return handle_plugin(argc - 1, &argv[1], extension);
+ extension = extension->next;
+ }
- /* If the command is executed with the extension name and
- * command together ("plugin-command"), run the plug in */
+ /* If the command is executed with the extension name and
+ * command together ("plugin-command"), run the plug in */
+ extension = plugin->next;
+ while (extension) {
if (!strncmp(str, extension->name, strlen(extension->name))) {
argv[0] += strlen(extension->name);
while (*argv[0] == '-')