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

Function isKnownSubcommand

src/utils/shell/specPrefix.ts:40–48  ·  view source on GitHub ↗
(arg: string, spec: CommandSpec | null)

Source from the content-addressed store, hash-verified

38// Check if an argument matches a known subcommand (case-insensitive: PS
39// callers pass original-cased args; fig spec names are lowercase)
40function isKnownSubcommand(arg: string, spec: CommandSpec | null): boolean {
41 if (!spec?.subcommands?.length) return false
42 const argLower = arg.toLowerCase()
43 return spec.subcommands.some(sub =>
44 Array.isArray(sub.name)
45 ? sub.name.some(n => n.toLowerCase() === argLower)
46 : sub.name.toLowerCase() === argLower,
47 )
48}
49
50// Check if a flag takes an argument based on spec, or use heuristic
51function flagTakesArg(

Callers 3

flagTakesArgFunction · 0.70
findFirstSubcommandFunction · 0.70
buildPrefixFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected