Skip to content

Commit

Permalink
feat: add --hidden flag
Browse files Browse the repository at this point in the history
  • Loading branch information
jdx committed May 31, 2018
1 parent df41ce1 commit e6b9424
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/commands/commands.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,16 @@ export default class Commands extends Command {
static flags = {
help: flags.help({char: 'h'}),
json: flags.boolean({char: 'j', description: 'output in json format'}),
hidden: flags.boolean({description: 'also show hidden commands'}),
}

async run() {
const {flags} = this.parse(Commands)
const commands = this.config.commands
_.sortBy(commands, 'id')
let commands = this.config.commands
if (!flags.hidden) {
commands = commands.filter(c => !c.hidden)
}
commands = _.sortBy(commands, 'id')
if (flags.json) {
ux.styledJSON(commands)
} else {
Expand Down

0 comments on commit e6b9424

Please sign in to comment.