【问题标题】:Yeoman Get OptionsYeoman 获取选项
【发布时间】:2016-09-15 07:49:53
【问题描述】:

我写了这段代码:

this.option('username', {
    alias: 'u',
    name: 'Username',
    desc: 'A username used for Marketplace authentication',
    type: String,
    required: true
});

console.log(this.options.username);

我在终端中输入以下内容:

yo test -username MrZerg

我回来了:

true

但我期待:“虫族先生”!

【问题讨论】:

    标签: node.js yeoman yeoman-generator


    【解决方案1】:

    yo 正在使用meow 解析命令行输入。我认为您需要一个双 -- 用于选项输入。试试yo test --username MrZerg

    【讨论】:

    • 耻辱喵不支持类似于 Unix 用户二进制文件的更常见选项。
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2012-08-30
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多