本文整理匯總了TypeScript中yargs.completion函數的典型用法代碼示例。如果您正苦於以下問題:TypeScript completion函數的具體用法?TypeScript completion怎麽用?TypeScript completion使用的例子?那麽, 這裏精選的函數代碼示例或許可以為您提供幫助。
在下文中一共展示了completion函數的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的TypeScript代碼示例。
示例1: completion_async
function completion_async() {
let argv = yargs
.completion('completion', (current: string, argv: any, done: (completion: string[]) => void) => {
setTimeout(() => {
done([
'apple',
'banana'
]);
}, 500);
})
.argv;
}
示例2: completion_async
function completion_async() {
var argv = yargs
.completion('completion', (current, argv, done) => {
setTimeout(function () {
done([
'apple',
'banana'
]);
}, 500);
})
.argv;
}
示例3: completion_sync
function completion_sync() {
let argv = yargs
.completion('completion', (current, argv) => {
// 'current' is the current command being completed.
// 'argv' is the parsed arguments so far.
// simply return an array of completions.
return [
'foo',
'bar'
];
})
.argv;
}