Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Positional argument description does not show up with showHelp(), but works with --help #1912

Closed
gardenappl opened this issue Apr 11, 2021 · 3 comments · Fixed by #1913
Closed
Labels

Comments

@gardenappl
Copy link
Contributor

As the title suggests:

	.command("* [source]", __`Process HTML input`, (yargs) => { 
		yargs.positional("source", {
			desc: __`A file, an http(s) URL, or '-' for standard input`,
			type: "string"
		});
	})

With --help I get this:

index.js [source]

Process HTML input

Позиційні:
  source  A file, an http(s) URL, or '-' for standard input                                 [строка]

But with an explicit call to showHelp() I only get this:

index.js [source]

Process HTML input

Позиційні:
  source                                                                                    [строка]

(I explicitly call showHelp() whenever there is no [source] argument, and nothing is piped into stdin)

Tested with yargs 17.0.0-candidate.11, link to my full source code is here in case that matters.

@bcoe bcoe added the bug label Apr 11, 2021
bcoe added a commit that referenced this issue Apr 12, 2021
The builder for default commands was not being properly applied when .showHelp() and .getHelp() were used.

Fixes #1912
@bcoe
Copy link
Member

bcoe commented Apr 12, 2021

@gardenappl fix published to next (yargs@17.0.0-candidate.12) let me know if you continue to find any issues.

@gardenappl
Copy link
Contributor Author

Thanks for the fix

@Airkro
Copy link

Airkro commented Jul 2, 2021

description still missing when fail to parse

version: 17.0.1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
3 participants