}
}
- vshError(ctl, _("command '%s' doesn't support option --%s"),
- cmd->name, name);
+ if (STRNEQ(cmd->name, "help")) {
+ vshError(ctl, _("command '%s' doesn't support option --%s"),
+ cmd->name, name);
+ }
return NULL;
}
*optstr = '\0'; /* convert the '=' to '\0' */
optstr = vshStrdup(ctl, optstr + 1);
}
+ /* Special case 'help' to ignore all spurious options */
if (!(opt = vshCmddefGetOption(ctl, cmd, tkdata + 2,
&opts_seen, &opt_index))) {
VIR_FREE(optstr);
+ if (STREQ(cmd->name, "help"))
+ continue;
goto syntaxError;
}
VIR_FREE(tkdata);
continue;
} else {
get_data:
+ /* Special case 'help' to ignore spurious data */
if (!(opt = vshCmddefGetData(cmd, &opts_need_arg,
- &opts_seen))) {
+ &opts_seen)) &&
+ STRNEQ(cmd->name, "help")) {
vshError(ctl, _("unexpected data '%s'"), tkdata);
goto syntaxError;
}