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