Skip to content
This repository was archived by the owner on Jul 26, 2024. It is now read-only.

Commit 65deb98

Browse files
committed
added --run and --runtime-input for Haskell
--run was for Haskell only partially implemented and --runtime-input was completely missing. They are useful for starting an lsp.
1 parent 8b4e1ed commit 65deb98

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

nix-script-haskell/src/main.rs

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,10 @@ struct Opts {
3737
#[clap(long, requires("shell"))]
3838
run: Option<String>,
3939

40+
/// In shell mode, run this command instead of a shell.
41+
#[clap(long("runtime-input"), requires("shell"))]
42+
runtime_input: Vec<String>,
43+
4044
/// In shell mode, run a "pure" shell (that is, one that isolates the
4145
/// shell a little more from what you have in your environment.)
4246
#[clap(long, requires("shell"))]
@@ -96,6 +100,19 @@ impl Opts {
96100
.arg(format!("ghcid {}", script.display()));
97101
}
98102

103+
if let Some(cmd) = self.run.as_deref() {
104+
command
105+
.arg("--run")
106+
.arg(cmd);
107+
}
108+
109+
if !self.runtime_input.is_empty() {
110+
command.arg("--runtime-input");
111+
for input in &self.runtime_input {
112+
command.arg(input);
113+
}
114+
}
115+
99116
command.arg(script);
100117
command.args(args);
101118

0 commit comments

Comments
 (0)