Skip to main content

resolve_exec_command

Function resolve_exec_command 

Source
pub fn resolve_exec_command(
    profile: Option<&str>,
    inline: &[String],
    cfg: &ExecConfig,
) -> Result<Vec<String>>
Expand description

Resolve the argv gwm exec should run, from exactly one source: an inline -- <cmd> or a --profile <name> (issue #324).

The two are mutually exclusive and exactly one is required:

  • both given → error (the profile carries the command);
  • a --profile naming an entry absent from [exec.profiles] → error;
  • a profile whose command is empty → error (degenerate config);
  • neither given → error (nothing to run).

Every error path is a user-facing GwmError (exit 1), never a panic.