本文整理匯總了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;
}