removed newline after options and commands headers
Before adoption: this commit came in with the history the project adopted, so no landing records it.
authored by Jared Petersen · committed by Roman Vanesyan · parent 4c294c1 · Browse files · 6 files·+5 added−18 removed
This commit
State
Before adoption: this commit came in with the history the project adopted, so no landing records it.
Diff stats
6 files+5 added−18 removed
- tests:+2 added−5 removed
- other:+3 added−13 removed
Provenance
- Commit
2c20e91- Tree
fe74065- Author
Jared Petersen <jaredtoddpetersen@gmail.com>- Committer
Roman Vanesyan <romain.vanesyan@gmail.com>- Parent
4c294c1
6 files changed+5 added−18 removed
modified:test/test.command.help.js+2 added-2 removed
3 unmodified lines4567889101112123 unmodified lines
program.command('bare');
program.commandHelp().should.equal('Commands:\n\n bare\n');program.commandHelp().should.equal('Commands:\n bare\n');
program.command('mycommand [options]');
program.commandHelp().should.equal('Commands:\n\n bare\n mycommand [options]\n');program.commandHelp().should.equal('Commands:\n bare\n mycommand [options]\n');modified:test/test.command.helpInformation.js-2 removed
8 unmodified lines91011121313141517161718192 unmodified lines8 unmodified linesvar expectedHelpInformation = [ 'Usage: [options] [command]', '', 'Options:', '', ' -h, --help output usage information', '', 'Commands:', '', ' somecommand', ' anothercommand [options]', ''].join('\n');2 unmodified linesmodified:test/test.command.nohelp.js-1 removed
46 unmodified lines4748495051515253545546 unmodified linesvar output = process.stdout.write.args[0];
var expect = [ 'Commands:', '', ' mycommand [options] this is my command', ' anothercommand [options]', ' help [cmd] display help for [cmd]'].join('\n');output[0].indexOf(expect).should.not.be.equal(-1);modified:index.js-2 removed
1071 unmodified lines1072 var width = this.padWidth();1073 1074 return [1075 'Commands:',1076- '',1076 commands.map(function(cmd) {1077 var desc = cmd[1] ? ' ' + cmd[1] : '';1078 return (desc ? pad(cmd[0], width) : cmd[0]) + desc;1079 }).join('\n').replace(/^/gm, ' '),42 unmodified lines1122 if (commandHelp) cmds = [commandHelp];1123 1124 var options = [1125 'Options:',1127- '',1126 '' + this.optionHelp().replace(/^/gm, ' '),1127 ''1128 ];1129 106 unmodified linesmodified:Readme_zh-CN.md+3 added-7 removed
190 unmodified lines191 192 An application for pizzas ordering193 194 Options:195-195 -h, --help output usage information196 -V, --version output the version number197 -p, --peppers Add peppers198 -P, --pineapple Add pineapple25 unmodified lines224 // node's emit() is immediate225 226 program.on('--help', function(){227 console.log('');229- console.log(' Examples:');230- console.log('');231- console.log(' $ custom-help --help');232- console.log(' $ custom-help -h');228+ console.log('Examples:');229+ console.log(' $ custom-help --help');230+ console.log(' $ custom-help -h');231 });232 233 program.parse(process.argv);234 5 unmodified lines240 ```241 Usage: custom-help [options]242 243 Options:246-244 -h, --help output usage information245 -V, --version output the version number246 -f, --foo enable some foo247 -b, --bar enable some bar248 -B, --baz enable some baz249 250 Examples:254-251 $ custom-help --help252 $ custom-help -h253 ```254 79 unmodified linesmodified:Readme.md-4 removed
252 unmodified lines253 254 An application for pizzas ordering255 256 Options:257-257 -h, --help output usage information258 -V, --version output the version number259 -p, --peppers Add peppers260 -P, --pineapple Add pineapple31 unmodified lines292 293 program.on('--help', function(){294 console.log('')295 console.log('Examples:');297- console.log('');296 console.log(' $ custom-help --help');297 console.log(' $ custom-help -h');298 });299 7 unmodified lines307 ```308 Usage: custom-help [options]309 310 Options:313-311 -h, --help output usage information312 -V, --version output the version number313 -f, --foo enable some foo314 -b, --bar enable some bar315 -B, --baz enable some baz316 317 Examples:321-318 $ custom-help --help319 $ custom-help -h320 ```321 96 unmodified lines