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 {
6464 const descriptions = usageInstance . getDescriptions ( ) ;
6565 const groups = localYargsInstance . getGroups ( ) ;
6666 const positional = groups [ usageInstance . getPositionalGroupName ( ) ] as string [ ] | undefined ;
67-
67+ const seen = new Set < string > ( ) ;
6868 const hidden = new Set ( hiddenOptions ) ;
6969 const normalizeOptions : JsonHelpOption [ ] = [ ] ;
7070 const allAliases = new Set ( [ ...Object . values < string [ ] > ( aliases ) . flat ( ) ] ) ;
7171
72+ // Reverted order of https://github.com/yargs/yargs/blob/971e351705f0fbc5566c6ed1dfd707fa65e11c0d/lib/usage.ts#L419-L424
7273 for ( const [ names , type ] of [
74+ [ number , 'number' ] ,
7375 [ array , 'array' ] ,
7476 [ string , 'string' ] ,
7577 [ boolean , 'boolean' ] ,
76- [ number , 'number' ] ,
7778 ] ) {
7879 for ( const name of names ) {
79- if ( allAliases . has ( name ) || hidden . has ( name ) ) {
80+ if ( allAliases . has ( name ) || hidden . has ( name ) || seen . has ( name ) ) {
8081 // Ignore hidden, aliases and already visited option.
8182 continue ;
8283 }
8384
85+ seen . add ( name ) ;
8486 const positionalIndex = positional ?. indexOf ( name ) ?? - 1 ;
8587 const alias = aliases [ name ] ;
8688
You can’t perform that action at this time.
0 commit comments