Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Removed newline after Options and Commands headers #864

Merged
merged 1 commit into from Sep 26, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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