-
Notifications
You must be signed in to change notification settings - Fork 1k
Closed
Description
From the docs:
showHelpOnFail(enable: boolean, message?: string): Argv<T>;By default, yargs outputs a usage string if any error is detected. Use the .showHelpOnFail() method to customize this behavior.
Params:
enable – If false, the usage string is not output.
message – Message that is output after the error message.
We are using it in the following manner:
export const builder = function (yargs: yargs.Argv): yargs.Argv {
return yargs
.commandDir('feedback-commands', {
extensions: ['js'],
})
.strict()
.showHelpOnFail(false, `Use ' --help' for usage`)
.demandCommand();
};However, the string passed in the parameter message is never displayed. Only the error message Not enough non-option arguments: got 0, need at least 1 is being displayed.
To be clear, we want to not display the help page but print a string after the error message instead.
PS: The string also doesn't get displayed when the parameter value is set true since --help output instead.
We are on version 17.0.1 but I tried with 17.0.3 as well and same result.
Reactions are currently unavailable