diff --git a/nix-script-haskell/src/main.rs b/nix-script-haskell/src/main.rs index b267f097..391d648c 100644 --- a/nix-script-haskell/src/main.rs +++ b/nix-script-haskell/src/main.rs @@ -37,6 +37,10 @@ struct Opts { #[clap(long, requires("shell"))] run: Option, + /// In shell mode, run this command instead of a shell. + #[clap(long("runtime-input"), requires("shell"))] + runtime_input: Vec, + /// In shell mode, run a "pure" shell (that is, one that isolates the /// shell a little more from what you have in your environment.) #[clap(long, requires("shell"))] @@ -96,6 +100,17 @@ impl Opts { .arg(format!("ghcid {}", script.display())); } + if let Some(cmd) = self.run.as_deref() { + command.arg("--run").arg(cmd); + } + + if !self.runtime_input.is_empty() { + command.arg("--runtime-input"); + for input in &self.runtime_input { + command.arg(input); + } + } + command.arg(script); command.args(args);