File tree Expand file tree Collapse file tree 1 file changed +9
-8
lines changed
Expand file tree Collapse file tree 1 file changed +9
-8
lines changed Original file line number Diff line number Diff line change @@ -293,12 +293,7 @@ export class RootCommand extends Command {
293293 command . options
294294 ) ;
295295
296- this . completions = toComplete . includes ( '=' )
297- ? suggestions . map ( ( s ) => ( {
298- value : `${ optionName } =${ s . value } ` ,
299- description : s . description ,
300- } ) )
301- : suggestions ;
296+ this . completions = suggestions ;
302297 }
303298 return ;
304299 }
@@ -428,7 +423,14 @@ export class RootCommand extends Command {
428423 seen . add ( comp . value ) ;
429424 return true ;
430425 } )
431- . filter ( ( comp ) => comp . value . startsWith ( toComplete ) )
426+ . filter ( ( comp ) => {
427+ if ( toComplete . includes ( '=' ) ) {
428+ // for --option=value format, extract the value part after =
429+ const [ , valueToComplete ] = toComplete . split ( '=' ) ;
430+ return comp . value . startsWith ( valueToComplete ) ;
431+ }
432+ return comp . value . startsWith ( toComplete ) ;
433+ } )
432434 . forEach ( ( comp ) =>
433435 console . log ( `${ comp . value } \t${ comp . description ?? '' } ` )
434436 ) ;
@@ -541,7 +543,6 @@ export class RootCommand extends Command {
541543
542544const t = new RootCommand ( ) ;
543545
544- // TODO: re-check the below
545546export function script ( shell : string , name : string , executable : string ) {
546547 t . setup ( name , executable , shell ) ;
547548}
You can’t perform that action at this time.
0 commit comments