From 4c21283a7b6a8b70235954ad28f02aeb5130f8b3 Mon Sep 17 00:00:00 2001 From: Pascal Hartig Date: Sat, 7 Sep 2013 23:14:45 +0200 Subject: [PATCH] Adjust `yo generator --help` usage output Used to still say `yeoman init` by default. --- lib/base.js | 11 +++-------- test/base.js | 4 ++-- 2 files changed, 5 insertions(+), 10 deletions(-) diff --git a/lib/base.js b/lib/base.js index 4f308e0f..7f8cbc25 100644 --- a/lib/base.js +++ b/lib/base.js @@ -461,17 +461,12 @@ Base.prototype.help = function help() { */ Base.prototype.usage = function usage() { - var args = this._arguments.map(function (arg) { - return arg.config.banner; - }).join(' '); - - var options = this._options.length ? '[options]' : '', - name = (this.namespace === 'yeoman:app' || !this.namespace) ? '' : this.namespace + ' ', - cmd = 'init'; + var options = this._options.length ? '[options]' : ''; + var name = this.generatorName ? ' ' + this.generatorName : ''; name = name.replace(/^yeoman:/, ''); - var out = 'yeoman ' + cmd + ' ' + name + args + ' ' + options; + var out = 'yo' + name + ' ' + options; if (this.description) { out += '\n\n' + this.description; diff --git a/test/base.js b/test/base.js index d20bfd47..62d519d0 100644 --- a/test/base.js +++ b/test/base.js @@ -257,7 +257,7 @@ describe('yeoman.generators.Base', function () { var help = this.dummy.help(); assert.ok(help.match('Usage:')); - assert.ok(help.match('yeoman init FOO one two three \\[options\\]')); + assert.ok(help.match('yo \\[options\\]')); assert.ok(help.match('A new desc for this generator')); assert.ok(help.match('Options:')); assert.ok(help.match('--help # Print generator\'s options and usage')); @@ -268,7 +268,7 @@ describe('yeoman.generators.Base', function () { describe('generator.usage()', function () { it('should return the expected help / usage output', function () { var usage = this.dummy.usage(); - assert.equal(usage, 'yeoman init FOO one two three [options]\n\nA new desc for this generator'); + assert.equal(usage, 'yo [options]\n\nA new desc for this generator'); }); });