File tree 1 file changed +3
-8
lines changed
1 file changed +3
-8
lines changed Original file line number Diff line number Diff line change @@ -110,25 +110,20 @@ export class SfCommandError extends SfError {
110
110
--second "my second"
111
111
*/
112
112
113
- // find the flag before the 'args' block that's valid, to append the args with its value as a suggestion
114
- // const target = output.find((flag, index) => flag.type === 'flag' && output[index + 1]?.type === 'arg');
115
-
116
- const catcher : Array < { flag : string ; args : string [ ] } > = [ ] ;
113
+ const aggregator : Array < { flag : string ; args : string [ ] } > = [ ] ;
117
114
output . forEach ( ( k , i ) => {
118
115
let argCounter = i + 1 ;
119
116
if ( k . type === 'flag' && output [ argCounter ] . type === 'arg' ) {
120
117
const args : string [ ] = [ ] ;
121
- // add the flag name, and first correctly parsed value to the suggestion
122
-
123
118
while ( output [ argCounter ] ?. type === 'arg' ) {
124
119
args . push ( output [ argCounter ] . input ) ;
125
120
argCounter ++ ;
126
121
}
127
- catcher . push ( { flag : k . flag , args : [ k . input , ...args ] } ) ;
122
+ aggregator . push ( { flag : k . flag , args : [ k . input , ...args ] } ) ;
128
123
}
129
124
} ) ;
130
125
131
126
this . actions ??= [ ] ;
132
- this . actions . push ( ...catcher . map ( ( cause ) => `--${ cause . flag } "${ cause . args . join ( ' ' ) } "` ) ) ;
127
+ this . actions . push ( ...aggregator . map ( ( cause ) => `--${ cause . flag } "${ cause . args . join ( ' ' ) } "` ) ) ;
133
128
}
134
129
}
You can’t perform that action at this time.
0 commit comments