Hide rm alias from help while keeping it in completions

This commit is contained in:
Chris Wanstrath 2026-02-20 18:55:24 -08:00
parent 37665aac58
commit 76797569e1
2 changed files with 1 additions and 2 deletions

View File

@ -82,7 +82,7 @@ program
.action((branch: string, opts: { force?: boolean }) => closeAction(branch, opts)) .action((branch: string, opts: { force?: boolean }) => closeAction(branch, opts))
program program
.command("rm") .command("rm", { hidden: true })
.argument("<branch>", "branch name") .argument("<branch>", "branch name")
.option("-f, --force", "close even if there are unsaved changes") .option("-f, --force", "close even if there are unsaved changes")
.description("Remove a session (alias for close)") .description("Remove a session (alias for close)")

View File

@ -17,7 +17,6 @@ export function action(program: Command) {
const branchCommands: string[] = [] const branchCommands: string[] = []
for (const cmd of program.commands) { for (const cmd of program.commands) {
if ((cmd as any)._hidden) continue
const name = cmd.name() const name = cmd.name()
const desc = cmd.description() const desc = cmd.description()
const subs = cmd.commands as Command[] const subs = cmd.commands as Command[]