333
// 'args' is the array of strings from the line to be completed
334
getCompletion(args: string[], done: CompletionCallback): any {
335
>
const current = args.length ? args[args.length - 1] : '';
completion.ts
336
>
const argv = this.yargs.parse(args, true);
337
>
338
>
const completionFunction = this.customCompletionFunction
339
>
? (argv: Arguments) => this.customCompletion(args, argv, current, done)
340
>
: (argv: Arguments) => this.defaultCompletion(args, argv, current, done);
341
>
342
>
return isPromise(argv)
343
>
? argv.then(completionFunction)
344
>
: completionFunction(argv);
345
>
}
346
347
// generate the completion script to add to your .bashrc.