Skip to content
Myr

Fix help section order and padding (#652)

Before adoption: this commit came in with the history the project adopted, so no landing records it.

* Change help section order Fixes tj/commander.js#500 Previous display order : Usage > Commands > Description > Options New display order: Usage > Description > Options > Commands * Fix inconsistent padding between help sections

authored by Valentin Trinqué · committed by Roman Vanesyan · parent 1e4c689 · Browse files · 2 files+4 added−3 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

2 files+4 added−3 removed

  • other:+4 added−3 removed

2 files+4 added−3 removed

modified:examples/pm+1 added
2 unmodified lines
3var program = require('..');45program6 .version('0.0.1')7 .description('Fake package manager')8 .command('install [name]', 'install one or more packages').alias('i')9 .command('search [query]', 'search with optional query').alias('s')10 .command('list', 'list packages installed')11 .command('publish', 'publish the package').alias('p')
17 unmodified lines
modified:index.js+3 added-3 removed
1019 unmodified lines
1020 var commandHelp = this.commandHelp();1021 if (commandHelp) cmds = [commandHelp];10221023 var options = [1024 ''1024 ' Options:'1025 , ' Options:'1026 , ''1027 , '' + this.optionHelp().replace(/^/gm, ' ')1028 , ''1028 , ''1029 ];10301031 return usage1032 .concat(cmds)1032 .concat(desc)1033 .concat(options)1034 .concat(cmds)1035 .join('\n');1036};10371038/**
99 unmodified lines