diff --git a/Cargo.lock b/Cargo.lock index 069ba7b..58caacc 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1109,7 +1109,7 @@ checksum = "04744f49eae99ab78e0d5c0b603ab218f515ea8cfe5a456d7629ad883a3b6e7d" [[package]] name = "oseda-cli" -version = "3.1.0" +version = "3.1.1" dependencies = [ "chrono", "clap", diff --git a/Cargo.toml b/Cargo.toml index fab0a71..463fe51 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -6,7 +6,7 @@ homepage = "https://oseda.net" repository = "https://github.com/oseda-dev/oseda-cli" readme = "README.md" name = "oseda-cli" -version = "3.1.0" +version = "3.1.1" edition = "2021" [[bin]] diff --git a/src/cmd/deploy.rs b/src/cmd/deploy.rs index 9c64787..5d5fb07 100644 --- a/src/cmd/deploy.rs +++ b/src/cmd/deploy.rs @@ -10,7 +10,12 @@ use crate::{ /// Options for the `oseda deploy` command #[derive(Args, Debug)] pub struct DeployOptions { + /// URL to fork of oseda-lib GitHub repository + #[arg(value_name = "FORK_URL")] fork_url: String, + /// Run in quiet mode (e.g. do not open PR in browser) + #[arg(long, value_name = "QUIET")] + quiet: bool, } struct SshUrl(String); @@ -109,9 +114,11 @@ pub fn deploy(opts: DeployOptions) -> Result<(), Box> { println!(); println!("{}", pull_request_url); - if open::that(pull_request_url.clone()).is_err() { - return Err(format!("Please visit {pull_request_url} in a browser and submit a pull-request by hand").into()); - }; + if !opts.quiet { + open::that(pull_request_url.clone()).map_err(|_| { + format!("Please visit {pull_request_url} in a browser and submit a pull-request by hand") + })?; + } } None => { println!("Error: could not get github username");