MCPcopy Create free account
hub / github.com/freecodexyz/free-code / commandHasArg

Function commandHasArg

src/utils/powershell/parser.ts:1608–1614  ·  view source on GitHub ↗
(
  command: ParsedCommandElement,
  arg: string,
)

Source from the content-addressed store, hash-verified

1606 * Useful for checking "-EncodedCommand", "-Recurse", etc.
1607 */
1608export function commandHasArg(
1609 command: ParsedCommandElement,
1610 arg: string,
1611): boolean {
1612 const lowerArg = arg.toLowerCase()
1613 return command.args.some(a => a.toLowerCase() === lowerArg)
1614}
1615
1616/**
1617 * Tokenizer-level dash characters that PowerShell's parser accepts as

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected