本文整理汇总了TypeScript中yargs.showHelp函数的典型用法代码示例。如果您正苦于以下问题:TypeScript showHelp函数的具体用法?TypeScript showHelp怎么用?TypeScript showHelp使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了showHelp函数的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的TypeScript代码示例。
示例1: init
public static init(opts: CLI): void {
if (!opts.help) {
this.start(opts).catch(err => {
logger.error(err);
process.exitCode = 1;
});
} else {
yargs.showHelp();
process.exitCode = 0;
}
}
开发者ID:krishnasrinivas,项目名称:wetty,代码行数:11,代码来源:index.ts
示例2: tsxWrapper
(() => {
if (!isScriptCalledDirectly()) {
return
}
const argv = yargsLib
.usage('$0 <cmd> [args]')
.command('solConcat <solidityInputFile> <outputDirectory> [options]', 'create one solidity file from solidity source code including imports', solConcatArgs, solConcatWrapper)
.command('solBuild <solidityInputFile> <outputDirectory> [options]', 'compile solidity contract', solBuildArgs, solBuildWrapper)
.command('tsxBuild <inputRootDir> <inputFile> <outputDirectory> [options]', 'build GUI', tsxBuildWatchArgs, tsxWrapper(tsxBuild))
.command('tsxWatch <inputRootDir> <inputFile> <outputDirectory> [options]', 'watch project an rebuild on changes', tsxBuildWatchArgs, tsxWrapper(tsxWatch))
.command('cssTypeBuild <inputRootDir> [options]', 'build css TS type definitions', cssTypeBuildWatchArgs, cssTypeWrapper(cssTypeBuild))
.command('cssTypeWatch <inputRootDir> [options]', 'watch css TS type definitions', cssTypeBuildWatchArgs, cssTypeWrapper(cssTypeWatch))
.strict()
.help()
.argv
// show help when no parameters passed
if (!argv._[0]) {
yargsLib.showHelp()
}
})()
开发者ID:ondratra,项目名称:soliditySapper,代码行数:22,代码来源:index.ts
示例3:
function Argv$showHelpConsoleLevel() {
yargs.showHelp("log"); // prints to stdout using console.log()
}
开发者ID:markusmauch,项目名称:DefinitelyTyped,代码行数:3,代码来源:yargs-tests.ts
示例4: switch
})
.command("uninstall", "Uninstall a system or plugin", (yargs) => {
yargs.demand(2, 2, `The "uninstall" command requires a single argument: "systemId" or "systemId:pluginAuthor/pluginName"`).argv;
})
.command("update", "Update the server, a system or a plugin", (yargs) => {
yargs.demand(2, 2, `The "update" command requires a single argument: server, "systemId" or "systemId:pluginAuthor/pluginName"`).argv;
})
.command("init", "Generate a skeleton for a new system or plugin", (yargs) => {
yargs.demand(2, 2, `The "init" command requires a single argument: "systemId" or "systemId:pluginAuthor/pluginName"`).argv;
})
.help("h").alias("h", "help")
.argv;
const command = argv._[0];
const [ systemId, pluginFullName ] = argv._[1] != null ? argv._[1].split(":") : [ null, null ];
switch (command) {
/* tslint:disable */
case "start": require("./commands/start").default(dataPath); break;
case "list": require("./commands/list").default(); break;
case "registry": require("./commands/registry").default(); break;
case "install": require("./commands/install").default(systemId, pluginFullName); break;
case "uninstall": require("./commands/uninstall").default(systemId, pluginFullName); break;
case "update": require("./commands/update").default(systemId, pluginFullName); break;
case "init": require("./commands/init").default(systemId, pluginFullName); break;
/* tslint:enable */
default:
yargs.showHelp();
process.exit(1);
break;
}
开发者ID:AndreLewin,项目名称:superpowers-core,代码行数:30,代码来源:index.ts
注:本文中的yargs.showHelp函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论