Skip to content

Commit

Permalink
removed newline after options and commands headers
Browse files Browse the repository at this point in the history
  • Loading branch information
jaredpetersen authored and roman-vanesyan committed Sep 26, 2018
1 parent 4c294c1 commit 2c20e91
Show file tree
Hide file tree
Showing 6 changed files with 5 additions and 18 deletions.
4 changes: 0 additions & 4 deletions Readme.md
Expand Up @@ -254,7 +254,6 @@ Usage: pizza [options]
An application for pizzas ordering
Options:
-h, --help output usage information
-V, --version output the version number
-p, --peppers Add peppers
Expand Down Expand Up @@ -294,7 +293,6 @@ program
program.on('--help', function(){
console.log('')
console.log('Examples:');
console.log('');
console.log(' $ custom-help --help');
console.log(' $ custom-help -h');
});
Expand All @@ -310,15 +308,13 @@ Yields the following help output when `node script-name.js -h` or `node script-n
Usage: custom-help [options]
Options:
-h, --help output usage information
-V, --version output the version number
-f, --foo enable some foo
-b, --bar enable some bar
-B, --baz enable some baz
Examples:
$ custom-help --help
$ custom-help -h
```
Expand Down
10 changes: 3 additions & 7 deletions Readme_zh-CN.md
Expand Up @@ -192,7 +192,6 @@ Usage: pizza [options]
An application for pizzas ordering
Options:
-h, --help output usage information
-V, --version output the version number
-p, --peppers Add peppers
Expand Down Expand Up @@ -226,10 +225,9 @@ program

program.on('--help', function(){
console.log('');
console.log(' Examples:');
console.log('');
console.log(' $ custom-help --help');
console.log(' $ custom-help -h');
console.log('Examples:');
console.log(' $ custom-help --help');
console.log(' $ custom-help -h');
});

program.parse(process.argv);
Expand All @@ -243,15 +241,13 @@ console.log('stuff');
Usage: custom-help [options]
Options:
-h, --help output usage information
-V, --version output the version number
-f, --foo enable some foo
-b, --bar enable some bar
-B, --baz enable some baz
Examples:
$ custom-help --help
$ custom-help -h
```
Expand Down
2 changes: 0 additions & 2 deletions index.js
Expand Up @@ -1073,7 +1073,6 @@ Command.prototype.commandHelp = function() {

return [
'Commands:',
'',
commands.map(function(cmd) {
var desc = cmd[1] ? ' ' + cmd[1] : '';
return (desc ? pad(cmd[0], width) : cmd[0]) + desc;
Expand Down Expand Up @@ -1124,7 +1123,6 @@ Command.prototype.helpInformation = function() {

var options = [
'Options:',
'',
'' + this.optionHelp().replace(/^/gm, ' '),
''
];
Expand Down
4 changes: 2 additions & 2 deletions test/test.command.help.js
Expand Up @@ -5,8 +5,8 @@ var program = require('../')

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');
2 changes: 0 additions & 2 deletions test/test.command.helpInformation.js
Expand Up @@ -10,11 +10,9 @@ var expectedHelpInformation = [
'Usage: [options] [command]',
'',
'Options:',
'',
' -h, --help output usage information',
'',
'Commands:',
'',
' somecommand',
' anothercommand [options]',
''
Expand Down
1 change: 0 additions & 1 deletion test/test.command.nohelp.js
Expand Up @@ -48,7 +48,6 @@ var output = process.stdout.write.args[0];

var expect = [
'Commands:',
'',
' mycommand [options] this is my command',
' anothercommand [options]',
' help [cmd] display help for [cmd]'
Expand Down

0 comments on commit 2c20e91

Please sign in to comment.