MCPcopy
hub / github.com/coder/mux / tokenizeCommandLine

Function tokenizeCommandLine

src/browser/utils/slashCommands/registry.ts:24–28  ·  view source on GitHub ↗
(input: string)

Source from the content-addressed store, hash-verified

22import { WORKSPACE_ONLY_COMMAND_KEYS } from "@/constants/slashCommands";
23
24function tokenizeCommandLine(input: string): string[] {
25 return (input.match(/(?:[^\s"]+|"[^"]*")+/g) ?? []).map((token) =>
26 token.replace(/^"(.*)"$/, "$1")
27 );
28}
29
30/**
31 * Parse multiline command input into first-line tokens and remaining message.

Callers 2

parseMultilineCommandFunction · 0.85
parseCommandHeaderBodyFunction · 0.85

Calls 1

matchMethod · 0.80

Tested by

no test coverage detected