Skip to content

Commit

Permalink
Re-added default help on commands.
Browse files Browse the repository at this point in the history
  • Loading branch information
coreybutler committed Apr 30, 2020
1 parent 546e4c6 commit f42b94e
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@author.io/shell",
"version": "1.3.10",
"version": "1.3.11-beta.1",
"description": "A micro-framework for creating CLI-like experiences. This supports Node.js and browsers.",
"main": "src/index.js",
"scripts": {
Expand Down
12 changes: 6 additions & 6 deletions src/command.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,13 +33,13 @@ export default class Command extends Base {
cfg.middleware.forEach(code => this.use(Function(code)))
}

// this.defaultHandler = (data, cb) => {
// if (data.help && data.help.requested) {
// console.log(data.help.message)
// }
this.defaultHandler = (data, cb) => {
if (data.help && data.help.requested) {
console.log(data.help.message)
}

// cb && cb(data)
// }
cb && cb(data)
}

this.#fn = cfg.handler
this.#oid = Symbol(((cfg.name || cfg.usage) || cfg.pattern) || 'command')
Expand Down

0 comments on commit f42b94e

Please sign in to comment.