本文整理汇总了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;