diff options
author | Matthias Beyer <matthias.beyer@atos.net> | 2021-04-21 15:32:33 +0200 |
---|---|---|
committer | Matthias Beyer <matthias.beyer@atos.net> | 2021-04-21 15:32:33 +0200 |
commit | 8f88a07ab48c1592f22db6aeedd5d3c920ea99e3 (patch) | |
tree | e1455c5e1382d9f56ca06cd6455f5f35af8fa1f6 | |
parent | 17aea85fb6a923313c62939c382445052b2f62dc (diff) |
Add option to disable printing of released file pathes
Signed-off-by: Matthias Beyer <matthias.beyer@atos.net>
-rw-r--r-- | src/cli.rs | 7 | ||||
-rw-r--r-- | src/commands/release.rs | 7 |
2 files changed, 13 insertions, 1 deletions
@@ -820,6 +820,13 @@ pub fn cli<'a>() -> App<'a> { .about("Dont be interactive (only with --update at the moment)") .requires("package_do_update") ) + .arg(Arg::new("quiet") + .required(false) + .multiple(false) + .long("quiet") + .short('q') + .about("Don't print pathes to released filesfiles after releases are complete") + ) ) ) diff --git a/src/commands/release.rs b/src/commands/release.rs index 0bc59bb..0628d40 100644 --- a/src/commands/release.rs +++ b/src/commands/release.rs @@ -43,6 +43,7 @@ async fn new_release( config: &Configuration, matches: &ArgMatches, ) -> Result<()> { + let print_released_file_pathes = !matches.is_present("quiet"); let release_store_name = matches.value_of("release_store_name").unwrap(); // safe by clap if !(config.releases_directory().exists() && config.releases_directory().is_dir()) { return Err(anyhow!( @@ -178,7 +179,11 @@ async fn new_release( let rel = crate::db::models::Release::create(&conn, &art, &now, &release_store)?; debug!("Release object = {:?}", rel); - writeln!(std::io::stdout(), "{}", dest_path.display()).map_err(Error::from) + if print_released_file_pathes { + writeln!(std::io::stdout(), "{}", dest_path.display()).map_err(Error::from) + } else { + Ok(()) + } }) } |