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...]`,
|
`${CMD} [OPTIONS] [VALUE...]`,
|
||||||
'',
|
'',
|
||||||
'Options:',
|
'Options:',
|
||||||
' --value [VALUE...] (required)',
|
|
||||||
' --other number ',
|
' --other number ',
|
||||||
' --help boolean ',
|
' --help boolean ',
|
||||||
].join('\n'))
|
].join('\n'))
|
||||||
@ -381,8 +380,6 @@ describe('argparse', () => {
|
|||||||
'Options:',
|
'Options:',
|
||||||
'-o, --one string first argument ' +
|
'-o, --one string first argument ' +
|
||||||
'(required, default: choice-1, choices: choice-1,choice-2)',
|
'(required, default: choice-1, choices: choice-1,choice-2)',
|
||||||
' --two number (required)',
|
|
||||||
' --three number ',
|
|
||||||
' --help boolean ',
|
' --help boolean ',
|
||||||
].join('\n'))
|
].join('\n'))
|
||||||
})
|
})
|
||||||
|
|||||||
@ -193,7 +193,9 @@ export function help(command: string, config: IArgsConfig) {
|
|||||||
.join(' '),
|
.join(' '),
|
||||||
].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 argConfig = config[argument]
|
||||||
const {alias, type} = argConfig
|
const {alias, type} = argConfig
|
||||||
const name = alias
|
const name = alias
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user