Skip to content

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

@gardenappl

Description

@gardenappl

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions