MCPcopy Index your code
hub / github.com/codeaashu/claude-code / isKnownSubcommand

Function isKnownSubcommand

src/utils/bash/prefix.ts:18–26  ·  view source on GitHub ↗
(
  arg: string,
  spec: { subcommands?: { name: string | string[] }[] } | null,
)

Source from the content-addressed store, hash-verified

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).
18function 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
28export async function getCommandPrefixStatic(
29 command: string,

Callers 1

getCommandPrefixStaticFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected