Skip to main content

walk_commands

Function walk_commands 

Source
pub fn walk_commands(
    cmd_name: &str,
    tail: &[String],
    top_commands: &BTreeMap<String, CommandSpec>,
    project_root: &Path,
    env: Option<&str>,
) -> WalkOutcome
Expand description

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.

  • cmd_name: the top-level token the user typed (fdl <cmd_name> ...).
  • tail: positional args following cmd_name (typically &args[2..]).
  • top_commands: the root commands: block (usually &project.commands).
  • project_root: the directory containing the base fdl.yml; acts as the initial current_dir for Path resolution.
  • env: active overlay name, threaded to each load_command_with_env call so descended configs pick up env-layered fields.