File tree Expand file tree Collapse file tree 1 file changed +5
-3
lines changed
packages/angular/cli/src/command-builder/utilities Expand file tree Collapse file tree 1 file changed +5
-3
lines changed Original file line number Diff line number Diff line change @@ -64,23 +64,25 @@ export function jsonHelpUsage(localYargs: Argv): string {
64
64
const descriptions = usageInstance . getDescriptions ( ) ;
65
65
const groups = localYargsInstance . getGroups ( ) ;
66
66
const positional = groups [ usageInstance . getPositionalGroupName ( ) ] as string [ ] | undefined ;
67
-
67
+ const seen = new Set < string > ( ) ;
68
68
const hidden = new Set ( hiddenOptions ) ;
69
69
const normalizeOptions : JsonHelpOption [ ] = [ ] ;
70
70
const allAliases = new Set ( [ ...Object . values < string [ ] > ( aliases ) . flat ( ) ] ) ;
71
71
72
+ // Reverted order of https://github.com/yargs/yargs/blob/971e351705f0fbc5566c6ed1dfd707fa65e11c0d/lib/usage.ts#L419-L424
72
73
for ( const [ names , type ] of [
74
+ [ number , 'number' ] ,
73
75
[ array , 'array' ] ,
74
76
[ string , 'string' ] ,
75
77
[ boolean , 'boolean' ] ,
76
- [ number , 'number' ] ,
77
78
] ) {
78
79
for ( const name of names ) {
79
- if ( allAliases . has ( name ) || hidden . has ( name ) ) {
80
+ if ( allAliases . has ( name ) || hidden . has ( name ) || seen . has ( name ) ) {
80
81
// Ignore hidden, aliases and already visited option.
81
82
continue ;
82
83
}
83
84
85
+ seen . add ( name ) ;
84
86
const positionalIndex = positional ?. indexOf ( name ) ?? - 1 ;
85
87
const alias = aliases [ name ] ;
86
88
You can’t perform that action at this time.
0 commit comments