When a given string for a subcommand is not valid, we can return EINVAL which
means invalid arguments. ENOTTY is used to indicate that an invalid IOCTL
number was specified.
Signed-off-by: Minwoo Im <minwoo.im@samsung.com>
setlocale(LC_ALL, "");
ret = handle_plugin(argc - 1, &argv[1], nvme.extensions);
- if (ret == -ENOTTY)
+ if (ret == -EINVAL)
general_help(&builtin);
return ret;
/* Check extensions only if this is running the built-in plugin */
if (plugin->name) {
printf("ERROR: Invalid sub-command '%s' for plugin %s\n", str, plugin->name);
- return -ENOTTY;
+ return -EINVAL;
}
extension = plugin->next;
extension = extension->next;
}
printf("ERROR: Invalid sub-command '%s'\n", str);
- return -ENOTTY;
+ return -EINVAL;
}