(command: string)
| 252 | } |
| 253 | |
| 254 | function parseCommandSegment(command: string): ExploreEntry[] | null { |
| 255 | const tokens = tokenizeCommand(command); |
| 256 | if (tokens.length === 0) { |
| 257 | return null; |
| 258 | } |
| 259 | const commandName = tokens[0].toLowerCase(); |
| 260 | if (READ_COMMANDS.has(commandName)) { |
| 261 | return parseRead(tokens); |
| 262 | } |
| 263 | if (LIST_COMMANDS.has(commandName)) { |
| 264 | return [parseList(tokens)]; |
| 265 | } |
| 266 | if (SEARCH_COMMANDS.has(commandName)) { |
| 267 | const entry = parseSearch(tokens); |
| 268 | return entry ? [entry] : null; |
| 269 | } |
| 270 | return null; |
| 271 | } |
| 272 | |
| 273 | function coalesceReadEntries(entries: ExploreEntry[]) { |
| 274 | const result: ExploreEntry[] = []; |
no test coverage detected