Skip to content

Commit

Permalink
Change options and args order (#1063)
Browse files Browse the repository at this point in the history
* change args and options order

* update help tests
  • Loading branch information
mrDinckleman authored and SBoudrias committed Mar 26, 2018
1 parent e582a00 commit efc52c9
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions lib/actions/help.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
4 changes: 2 additions & 2 deletions test/base.js
Original file line number Diff line number Diff line change
Expand Up @@ -845,7 +845,7 @@ describe('Base', () => {
const help = this.dummy.help();
const expected = [
'Usage:',
'yo dummy [options] [<baz>]',
'yo dummy [<baz>] [options]',
'',
'A new desc for this generator',
'',
Expand Down Expand Up @@ -876,7 +876,7 @@ describe('Base', () => {
});

const usage = this.dummy.usage();
assert.equal(usage.trim(), 'yo dummy [options] [<baz>]');
assert.equal(usage.trim(), 'yo dummy [<baz>] [options]');
});

it('returns the expected usage output without arguments', function () {
Expand Down

0 comments on commit efc52c9

Please sign in to comment.