Skip to main content

Module shell

Module shell 

Source
Expand description

cmd_shell REPL migration. The line-handling logic is extracted into handle_command(parts, conn, out) so unit tests can drive command parsing/dispatch without spawning a subprocess. The outer stdin loop is intentionally minimal and is not covered by unit tests — its read_line blocking call would deadlock a buffer-driven test fixture.

Enums§

ShellAction
Returned by handle_command to signal whether the REPL should keep reading more lines.

Functions§

handle_command
REPL command dispatcher. Splits its input into a command + tail and emits all output through out. Returns Quit on quit/exit/q, Continue otherwise.
run
shell handler. Outer stdin loop. Not unit-tested — the blocking read_line call would deadlock a Vec<u8> test fixture; the line handler logic lives in handle_command, which is exhaustively tested.