本文整理汇总了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;
}
}
示例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()
}
})()
示例3:
function Argv$showHelpConsoleLevel() {
yargs.showHelp("log"); // prints to stdout using console.log()
}
示例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;
}