Skip to content

Commit

Permalink
fix: printing "undefined" (#52)
Browse files Browse the repository at this point in the history
  • Loading branch information
Skriptach authored and RasPhilCo committed Dec 3, 2019
1 parent 4595694 commit 0796793
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -63,12 +63,12 @@ export default class Help {

if (!subject) {
console.log(this.root())
console.log()
console.log('')
if (!this.opts.all) {
topics = topics.filter(t => !t.name.includes(':'))
}
console.log(this.topics(topics))
console.log()
console.log('')
} else if (command) {
this.showCommandHelp(command, topics)
} else if (topic) {
Expand All @@ -78,7 +78,7 @@ export default class Help {
console.log(this.topic(topic))
if (topics.length > 0) {
console.log(this.topics(topics))
console.log()
console.log('')
}
} else {
error(`command ${subject} not found`)
Expand All @@ -92,10 +92,10 @@ export default class Help {
const title = command.description && this.render(command.description).split('\n')[0]
if (title) console.log(title + '\n')
console.log(this.command(command))
console.log()
console.log('')
if (topics.length > 0) {
console.log(this.topics(topics))
console.log()
console.log('')
}
}

Expand Down

0 comments on commit 0796793

Please sign in to comment.