(
arg: string,
spec: { subcommands?: { name: string | string[] }[] } | null,
)
| 18 | // Check if args[0] matches a known subcommand (disambiguates wrapper commands |
| 19 | // that also have subcommands, e.g. the git spec has isCommand args for aliases). |
| 20 | function isKnownSubcommand( |
| 21 | arg: string, |
| 22 | spec: { subcommands?: { name: string | string[] }[] } | null, |
| 23 | ): boolean { |
| 24 | if (!spec?.subcommands?.length) return false |
| 25 | return spec.subcommands.some(sub => |
| 26 | Array.isArray(sub.name) ? sub.name.includes(arg) : sub.name === arg, |
| 27 | ) |
| 28 | } |
| 29 | |
| 30 | export async function getCommandPrefixStatic( |
| 31 | command: string, |
no outgoing calls
no test coverage detected