Expand description
Top-level command dispatch: routing argv to built-ins vs. manifest entries, resolving the three command kinds (run / path / preset). Pure command-graph dispatch.
walk_commands is the outer walker: it chases an arbitrarily nested
commands: graph starting from a top-level name + tail, and returns a
WalkOutcome describing what the caller should do (run a script,
spawn an entry, print help, error out, …). The walker performs no
IO of its own: no process spawning, no stdout writes, no cwd reads.
classify_path_step is the inner classifier used by walk_commands
for the Path arm: loads the child fdl.yml and inspects the tail to
decide whether to descend, render help, refresh the schema cache, or
forward to the entry.
Keeping all impure actions (printing, spawning) in the caller makes both functions straight-line and unit-testable against tempdir fixtures.
Enums§
- Path
Outcome - What a single
Path-kind step resolved to. Every variant holds the loadedchildconfig when applicable, so the caller doesn’t re-load. - Walk
Outcome - What the outer walker resolved a user invocation to. The caller owns every impure action (spawning, printing, exit code); the walker just returns the terminal state.
Functions§
- classify_
path_ step - Classify a
Path-kind step. Pure: loads the child config, inspects the tail, and returns the matchingPathOutcome. The caller owns every side effect (printing, spawning). - walk_
commands - Walk the command graph from a top-level name and produce a
WalkOutcome. Every transition is pure: the walker never spawns a process, prints to stdout, or reads the process cwd. Inputs carry all the context needed.