當前位置: 首頁>>代碼示例>>TypeScript>>正文


TypeScript yargs.options函數代碼示例

本文整理匯總了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' }
  });
}
開發者ID:mabels,項目名稱:clavator,代碼行數:16,代碼來源:simple-actions.ts

示例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
		;
}
開發者ID:CNManning,項目名稱:DefinitelyTyped,代碼行數:21,代碼來源:yargs-tests.ts

示例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
        ;
}
開發者ID:markusmauch,項目名稱:DefinitelyTyped,代碼行數:23,代碼來源:yargs-tests.ts

示例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;
開發者ID:christianvoigt,項目名稱:argdown,代碼行數:29,代碼來源:cli.ts


注:本文中的yargs.options函數示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。