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

Function getAllCommandNames

src/utils/powershell/parser.ts:1467–1480  ·  view source on GitHub ↗
(parsed: ParsedPowerShellCommand)

Source from the content-addressed store, hash-verified

1465 */
1466// exported for testing
1467export function getAllCommandNames(parsed: ParsedPowerShellCommand): string[] {
1468 const names: string[] = []
1469 for (const statement of parsed.statements) {
1470 for (const cmd of statement.commands) {
1471 names.push(cmd.name.toLowerCase())
1472 }
1473 if (statement.nestedCommands) {
1474 for (const cmd of statement.nestedCommands) {
1475 names.push(cmd.name.toLowerCase())
1476 }
1477 }
1478 }
1479 return names
1480}
1481
1482/**
1483 * Get all pipeline segments as flat list of commands.

Callers 3

extractCommandNameFunction · 0.85
hasCommandNamedFunction · 0.85
hasDirectoryChangeFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected