We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent b71254f commit ecbc037Copy full SHA for ecbc037
test/usage.cjs
@@ -4503,4 +4503,23 @@ describe('usage tests', () => {
4503
}
4504
});
4505
4506
+
4507
+ // Refs: https://github.com/yargs/yargs/issues/1820
4508
+ it('allows setting help and version with aliases and custom description', () => {
4509
+ const r = checkUsage(() =>
4510
+ yargs('--help')
4511
+ .describe('help', 'Custom help description')
4512
+ .describe('version', 'Custom version description')
4513
+ .alias('help', 'h')
4514
+ .alias('v', 'version')
4515
+ .parse()
4516
+ );
4517
+ r.logs[0]
4518
+ .split('\n')
4519
+ .should.deep.equal([
4520
+ 'Options:',
4521
+ ' -h, --help Custom help description [boolean]',
4522
+ ' -v, --version Custom version description [boolean]',
4523
+ ]);
4524
+ });
4525
0 commit comments