Skip to content

Commit cfe4f86

Browse files
committed
feat: add headless arg to install
1 parent 357d9e2 commit cfe4f86

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

crates/svm-rs/src/bin/svm-bin/install.rs

+7
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,10 @@ use semver::Version;
88
pub struct InstallCmd {
99
/// Solc versions to install.
1010
pub versions: Vec<String>,
11+
12+
/// Run in headless mode without prompting for user input.
13+
#[arg(long, default_value_t = false)]
14+
pub headless: bool,
1115
}
1216

1317
impl InstallCmd {
@@ -21,6 +25,9 @@ impl InstallCmd {
2125

2226
if installed_versions.contains(&version) {
2327
println!("Solc {version} is already installed");
28+
if self.headless {
29+
continue;
30+
}
2431
let input: String = Input::new()
2532
.with_prompt("Would you like to set it as the global version?")
2633
.with_initial_text("Y")

0 commit comments

Comments
 (0)