diff --git a/lib/actions/help.js b/lib/actions/help.js index a417cc31..8744a91e 100644 --- a/lib/actions/help.js +++ b/lib/actions/help.js @@ -70,11 +70,11 @@ help.usage = function () { let args = ''; if (this._arguments.length > 0) { - args = this._arguments.map(formatArg).join(' '); + args = this._arguments.map(formatArg).join(' ') + ' '; } name = name.replace(/^yeoman:/, ''); - let out = `yo ${name} ${options} ${args}`; + let out = `yo ${name} ${args}${options}`; if (this.description) { out += '\n\n' + this.description; diff --git a/test/base.js b/test/base.js index ece957d7..a9b352ef 100644 --- a/test/base.js +++ b/test/base.js @@ -845,7 +845,7 @@ describe('Base', () => { const help = this.dummy.help(); const expected = [ 'Usage:', - 'yo dummy [options] []', + 'yo dummy [] [options]', '', 'A new desc for this generator', '', @@ -876,7 +876,7 @@ describe('Base', () => { }); const usage = this.dummy.usage(); - assert.equal(usage.trim(), 'yo dummy [options] []'); + assert.equal(usage.trim(), 'yo dummy [] [options]'); }); it('returns the expected usage output without arguments', function () {