Skip to content
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.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 2 additions & 3 deletions lib/help.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,7 @@ module.exports = function() {
typeof this.config.value === 'string' ? ' ' + this.config.value : ''

parts.push([
'',
`Usage: ${this.printMainColor(name)} ${this.printSubColor(
` Usage: ${this.printMainColor(name)} ${this.printSubColor(
optionHandle + cmdHandle + value
)}`,
''
Expand All @@ -38,7 +37,7 @@ module.exports = function() {
continue
}

parts.push(['', firstBig(group) + ':', '', ''])
parts.push(['', firstBig(group) + ':', ''])

if (group === 'examples') {
parts.push(this.generateExamples())
Expand Down
2 changes: 1 addition & 1 deletion lib/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,7 @@ module.exports = {
}
const usage = this.printSubColor('$ ' + examples[item].usage)
const description = this.printMainColor('- ' + examples[item].description)
parts.push(` ${description}\n\n ${usage}\n\n`)
parts.push(` ${description}\n ${usage}\n`)
}

return parts
Expand Down
10 changes: 10 additions & 0 deletions test/_fixture.js
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -24,4 +24,14 @@ args.command('cmd', 'cmd desc', () => {

args.command('binary', 'some desc', ['b'])
args.option(['a', 'abc'], 'something', 'def value')
args.examples([
{
usage: 'args install -d',
description: 'Run the args command with the option -d'
},
{
usage: 'args uninstall -d',
description: 'Another description here'
}
])
args.parse(process.argv)