本文整理匯總了TypeScript中yargs.options函數的典型用法代碼示例。如果您正苦於以下問題:TypeScript options函數的具體用法?TypeScript options怎麽用?TypeScript options使用的例子?那麽, 這裏精選的函數代碼示例或許可以為您提供幫助。
在下文中一共展示了options函數的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的TypeScript代碼示例。
示例1: simpleActionsCli
export function simpleActionsCli(y: yargs.Argv, state: GpgMockState): yargs.Argv {
state.onParsed(quickAddKeyAction);
state.onParsed(exportSecretKeyAction);
state.onParsed(exportAction);
state.onParsed(exportSshKeyAction);
state.onParsed(deleteSecretKeyAction);
state.onParsed(deleteKeyAction);
return yargs.options({
'quick-addkey': { describe: 'quick-addkey action', boolean: true },
'export-secret-key': { describe: 'export secret key', type: 'string' },
export: { describe: 'export public key', type: 'string' },
'export-ssh-key': { describe: 'export ssh public key', type: 'string' },
'delete-secret-key': { describe: 'delete secret key', type: 'string' },
'delete-key': { describe: 'delete key', type: 'string' }
});
}
示例2:
function Argv$options() {
var argv1 = yargs
.options('f', {
alias: 'file',
default: '/etc/passwd',
defaultDescription: 'The /etc/passwd file',
group: 'files',
normalize: true,
global: false,
array: true,
nargs: 3
})
.argv
;
var argv2 = yargs
.alias('f', 'file')
.default('f', '/etc/passwd')
.argv
;
}
示例3:
function Argv$options() {
let argv1 = yargs
.options('f', {
alias: 'file',
default: '/etc/passwd',
defaultDescription: 'The /etc/passwd file',
group: 'files',
normalize: true,
global: false,
array: true,
nargs: 3,
implies: 'other-arg',
conflicts: 'conflicting-arg',
})
.argv
;
let argv2 = yargs
.alias('f', 'file')
.default('f', '/etc/passwd')
.argv
;
}
示例4: require
import * as yargs from "yargs";
require("pkginfo")(module, "version");
yargs
.options({
watch: {
alias: "w",
describe: "Watch the input files for changes",
type: "boolean",
default: false
},
config: {
alias: "cfg",
describe: "The path to the config .js file.",
type: "string"
},
verbose: {
alias: "v",
type: "boolean",
describe: "verbose mode"
},
stdout: {
type: "boolean",
describe: "Export data to stdout"
}
})
.commandDir("commands")
.help()
.version(module.exports.version).argv;