Reduce nesting in SSH-disabled command setup with early continue

This commit is contained in:
Chris Wanstrath 2026-03-17 19:18:26 -07:00
parent 0abf03e64e
commit 35a9053308

View File

@ -239,7 +239,7 @@ if (process.env.USER === 'cli') {
const disabled = ['shell', 'get', 'open'] const disabled = ['shell', 'get', 'open']
for (const name of disabled) { for (const name of disabled) {
const cmd = program.commands.find((c) => c.name() === name) const cmd = program.commands.find((c) => c.name() === name)
if (cmd) { if (!cmd) continue
cmd.helpInformation = () => '' cmd.helpInformation = () => ''
;(cmd as any)._hidden = true ;(cmd as any)._hidden = true
cmd.action(() => { cmd.action(() => {
@ -248,6 +248,5 @@ if (process.env.USER === 'cli') {
}) })
} }
} }
}
export { program } export { program }