File tree Expand file tree Collapse file tree 1 file changed +9
-1
lines changed
crates/svm-rs/src/bin/svm-bin Expand file tree Collapse file tree 1 file changed +9
-1
lines changed Original file line number Diff line number Diff line change @@ -8,6 +8,10 @@ use semver::Version;
88pub struct InstallCmd {
99 /// Solc versions to install.
1010 pub versions : Vec < String > ,
11+
12+ /// Run in non interactive mode without prompting for user input.
13+ #[ arg( long, default_value_t = false ) ]
14+ pub non_interactive : bool ,
1115}
1216
1317impl InstallCmd {
@@ -21,6 +25,9 @@ impl InstallCmd {
2125
2226 if installed_versions. contains ( & version) {
2327 println ! ( "Solc {version} is already installed" ) ;
28+ if self . non_interactive {
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" )
@@ -57,7 +64,8 @@ mod tests {
5764 assert_eq ! (
5865 args,
5966 InstallCmd {
60- versions: vec![ "0.8.11" . into( ) , "0.8.10" . into( ) ]
67+ versions: vec![ "0.8.11" . into( ) , "0.8.10" . into( ) ] ,
68+ non_interactive: false ,
6169 }
6270 ) ;
6371 }
You can’t perform that action at this time.
0 commit comments