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

Function parseArguments

src/utils/argumentSubstitution.ts:24–40  ·  view source on GitHub ↗
(args: string)

Source from the content-addressed store, hash-verified

22 * - "foo 'hello world' baz" => ["foo", "hello world", "baz"]
23 */
24export function parseArguments(args: string): string[] {
25 if (!args || !args.trim()) {
26 return []
27 }
28
29 // Return $KEY to preserve variable syntax literally (don't expand variables)
30 const result = tryParseShellCommand(args, key => `$${key}`)
31 if (!result.success) {
32 // Fall back to simple whitespace split if parsing fails
33 return args.split(/\s+/).filter(Boolean)
34 }
35
36 // Filter to only string tokens (ignore shell operators, etc.)
37 return result.tokens.filter(
38 (token): token is string => typeof token === 'string',
39 )
40}
41
42/**
43 * Parse argument names from the frontmatter 'arguments' field.

Callers 2

substituteArgumentsFunction · 0.85
useTypeaheadFunction · 0.85

Calls 1

tryParseShellCommandFunction · 0.85

Tested by

no test coverage detected