Skip to content

Commit

Permalink
[cli] Show available commands in help
Browse files Browse the repository at this point in the history
- use es6 string template literals #1
  • Loading branch information
at15 committed Sep 12, 2016
1 parent bb66e67 commit 98a3295
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions lib/cli/command.js
Original file line number Diff line number Diff line change
Expand Up @@ -132,12 +132,12 @@ class Command {

// default value
_.forEach(this.supportedFlags, (flag, name)=> {
if(!_.has(newFlags, name)){
if (!_.has(newFlags, name)) {
newFlags[name] = flag.defaultValue;
}
});
_.forEach(this.supportedGlobalFlags, (flag, name)=> {
if(!_.has(newFlags, name)){
if (!_.has(newFlags, name)) {
newFlags[name] = flag.defaultValue;
}
});
Expand All @@ -164,7 +164,10 @@ Usage:
Not supported
Available Commands:
Not supported
${_.map(this.subCommands, (cmd)=> {
// pad the command name for better output
return `${_.padEnd(cmd.name, 10)} ${cmd.description}`;
}).join('\n')}
Flags:
Not supported
Expand Down

0 comments on commit 98a3295

Please sign in to comment.