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

Function isPrintCommand

src/tools/BashTool/sedValidation.ts:128–133  ·  view source on GitHub ↗
(cmd: string)

Source from the content-addressed store, hash-verified

126 * @internal Exported for testing
127 */
128export function isPrintCommand(cmd: string): boolean {
129 if (!cmd) return false
130 // Single strict regex that only matches allowed print commands
131 // ^(?:\d+|\d+,\d+)?p$ matches: p, 1p, 123p, 1,5p, 10,200p
132 return /^(?:\d+|\d+,\d+)?p$/.test(cmd)
133}
134
135/**
136 * Pattern 2: Check if this is a substitution command

Callers 1

isLinePrintingCommandFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected