File tree Expand file tree Collapse file tree 1 file changed +25
-0
lines changed Expand file tree Collapse file tree 1 file changed +25
-0
lines changed Original file line number Diff line number Diff line change @@ -354,6 +354,31 @@ export const cli = yargs
354
354
. group ( 'verbose' , OptionGroups . Logging )
355
355
. group ( 'quiet' , OptionGroups . Logging )
356
356
. group ( 'silent' , OptionGroups . Logging )
357
+ . command (
358
+ subcommand (
359
+ {
360
+ name : [ 'completion [shell]' , 'completions [shell]' ] ,
361
+ description : 'Prints bash completions' ,
362
+ examples : [
363
+ [ '<(source $0 completion bash)' , 'Adds bash completions, put this in your bashrc' ] ,
364
+ ] ,
365
+ positional : {
366
+ shell : {
367
+ type : 'string' ,
368
+ demandOption : false ,
369
+ default : 'bash' ,
370
+ } ,
371
+ } ,
372
+ } ,
373
+ async ( { shell } ) => {
374
+ if ( shell !== 'bash' ) {
375
+ throw new AppConfigError ( 'Only bash autocompletions are available' ) ;
376
+ }
377
+
378
+ yargs . showCompletionScript ( ) ;
379
+ } ,
380
+ ) ,
381
+ )
357
382
. command (
358
383
subcommand (
359
384
{
You can’t perform that action at this time.
0 commit comments