Do not print help for positional arguments as options
This commit is contained in:
parent
c0b245067b
commit
9fc4b064da
@ -256,7 +256,6 @@ describe('argparse', () => {
|
||||
`${CMD} [OPTIONS] [VALUE...]`,
|
||||
'',
|
||||
'Options:',
|
||||
' --value [VALUE...] (required)',
|
||||
' --other number ',
|
||||
' --help boolean ',
|
||||
].join('\n'))
|
||||
@ -381,8 +380,6 @@ describe('argparse', () => {
|
||||
'Options:',
|
||||
'-o, --one string first argument ' +
|
||||
'(required, default: choice-1, choices: choice-1,choice-2)',
|
||||
' --two number (required)',
|
||||
' --three number ',
|
||||
' --help boolean ',
|
||||
].join('\n'))
|
||||
})
|
||||
|
||||
@ -193,7 +193,9 @@ export function help(command: string, config: IArgsConfig) {
|
||||
.join(' '),
|
||||
].join(' ')
|
||||
|
||||
const argsHelp = 'Options:\n' + keys.map(argument => {
|
||||
const options = keys.filter(k => !config[k].positional)
|
||||
|
||||
const argsHelp = 'Options:\n' + options.map(argument => {
|
||||
const argConfig = config[argument]
|
||||
const {alias, type} = argConfig
|
||||
const name = alias
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user