Skip to content

Commit d8a794c

Browse files
authored
Merge pull request #238 from oclif/wr/hideHiddenCommands
fix: filter out ignored commands from search
2 parents 4cf1aee + 53637e5 commit d8a794c

2 files changed

Lines changed: 3 additions & 1 deletion

File tree

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,3 +7,4 @@
77
/tmp
88
node_modules
99
oclif.manifest.json
10+
.idea/

src/commands/search.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,8 @@ export default class Search extends Command {
1414
public static description = 'Once you select a command, hit enter and it will show the help for that command.'
1515

1616
public async run(): Promise<unknown> {
17-
const commands = this.config.commands as Array<Command.Loadable & { readableId: string }>
17+
const commands = (this.config.commands as Array<Command.Loadable & { readableId: string }>).filter(c => !c.hidden)
18+
1819
for (const command of commands) {
1920
command.readableId = toConfiguredId(command.id, this.config)
2021
}

0 commit comments

Comments
 (0)