@@ -95,7 +95,14 @@ export class Command {
9595 alias ?: string ,
9696 isBoolean : boolean = false
9797 ) {
98- const option = new Option ( this , value , description , handler , alias , isBoolean ) ;
98+ const option = new Option (
99+ this ,
100+ value ,
101+ description ,
102+ handler ,
103+ alias ,
104+ isBoolean
105+ ) ;
99106 this . options . set ( value , option ) ;
100107 return this ;
101108 }
@@ -229,23 +236,28 @@ export class RootCommand extends Command {
229236
230237 this . completions = toComplete . includes ( '=' )
231238 ? suggestions . map ( ( s ) => ( {
232- value : `${ optionName } =${ s . value } ` ,
233- description : s . description ,
234- } ) )
239+ value : `${ optionName } =${ s . value } ` ,
240+ description : s . description ,
241+ } ) )
235242 : suggestions ;
236243 return ;
237244 }
238245 }
239246
240247 // Handle flag name completion
241248 if ( toComplete . startsWith ( '-' ) ) {
242- const isShortFlag = toComplete . startsWith ( '-' ) && ! toComplete . startsWith ( '--' ) ;
249+ const isShortFlag =
250+ toComplete . startsWith ( '-' ) && ! toComplete . startsWith ( '--' ) ;
243251 const cleanToComplete = toComplete . replace ( / ^ - + / , '' ) ;
244252 const isNegation = toComplete . startsWith ( '--no-' ) ;
245253
246254 for ( const [ name , option ] of command . options ) {
247255 // Handle short flag completion (-v, -d, etc)
248- if ( isShortFlag && option . alias && `-${ option . alias } ` . startsWith ( toComplete ) ) {
256+ if (
257+ isShortFlag &&
258+ option . alias &&
259+ `-${ option . alias } ` . startsWith ( toComplete )
260+ ) {
249261 const description = option . isBoolean
250262 ? `[boolean] ${ option . description } `
251263 : option . description ;
@@ -446,9 +458,9 @@ export class RootCommand extends Command {
446458 setup ( name : string , executable : string , shell : string ) {
447459 assert (
448460 shell === 'zsh' ||
449- shell === 'bash' ||
450- shell === 'fish' ||
451- shell === 'powershell' ,
461+ shell === 'bash' ||
462+ shell === 'fish' ||
463+ shell === 'powershell' ,
452464 'Unsupported shell'
453465 ) ;
454466
0 commit comments