Skip to content

Commit

Permalink
Fix help section order and padding (#652)
Browse files Browse the repository at this point in the history
* Change help section order

Fixes #500

Previous display order :

Usage > Commands > Description > Options

New display order:

Usage > Description > Options > Commands

* Fix inconsistent padding between help sections
  • Loading branch information
ValentinTrinque authored and roman-vanesyan committed Jul 3, 2017
1 parent 1e4c689 commit 14e5738
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
1 change: 1 addition & 0 deletions examples/pm
Expand Up @@ -4,6 +4,7 @@ var program = require('..');

program
.version('0.0.1')
.description('Fake package manager')
.command('install [name]', 'install one or more packages').alias('i')
.command('search [query]', 'search with optional query').alias('s')
.command('list', 'list packages installed')
Expand Down
6 changes: 3 additions & 3 deletions index.js
Expand Up @@ -1021,17 +1021,17 @@ Command.prototype.helpInformation = function() {
if (commandHelp) cmds = [commandHelp];

var options = [
' Options:'
''
, ' Options:'
, ''
, '' + this.optionHelp().replace(/^/gm, ' ')
, ''
, ''
];

return usage
.concat(cmds)
.concat(desc)
.concat(options)
.concat(cmds)
.join('\n');
};

Expand Down

0 comments on commit 14e5738

Please sign in to comment.