MCPcopy Create free account
hub / github.com/AnukarOP/claude-code-leaked / isKnownSubcommand

Function isKnownSubcommand

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

Source from the content-addressed store, hash-verified

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).
20function 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
30export async function getCommandPrefixStatic(
31 command: string,

Callers 1

getCommandPrefixStaticFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected