mirror of
https://github.com/rustic-rs/rustic.git
synced 2025-10-26 11:18:51 +00:00
feat: Add --quiet option to backup and forget (#964)
This commit is contained in:
parent
6f573f517b
commit
b8e0e40eac
@ -57,6 +57,11 @@ pub struct BackupCmd {
|
||||
#[merge(strategy = merge::bool::overwrite_false)]
|
||||
json: bool,
|
||||
|
||||
/// Don't show any output
|
||||
#[clap(long, conflicts_with = "json")]
|
||||
#[merge(strategy = merge::bool::overwrite_false)]
|
||||
quiet: bool,
|
||||
|
||||
/// Initialize repository, if it doesn't exist yet
|
||||
#[clap(long)]
|
||||
#[merge(strategy = merge::bool::overwrite_false)]
|
||||
@ -224,7 +229,7 @@ impl BackupCmd {
|
||||
if opts.json {
|
||||
let mut stdout = std::io::stdout();
|
||||
serde_json::to_writer_pretty(&mut stdout, &snap)?;
|
||||
} else {
|
||||
} else if !opts.quiet {
|
||||
let summary = snap.summary.unwrap();
|
||||
println!(
|
||||
"Files: {} new, {} changed, {} unchanged",
|
||||
|
||||
@ -30,6 +30,10 @@ pub(super) struct ForgetCmd {
|
||||
#[clap(long)]
|
||||
json: bool,
|
||||
|
||||
/// Don't show any output
|
||||
#[clap(long, conflicts_with = "json")]
|
||||
quiet: bool,
|
||||
|
||||
/// Forget options
|
||||
#[clap(flatten)]
|
||||
config: ForgetOptions,
|
||||
@ -122,7 +126,7 @@ impl ForgetCmd {
|
||||
if self.json {
|
||||
let mut stdout = std::io::stdout();
|
||||
serde_json::to_writer_pretty(&mut stdout, &groups)?;
|
||||
} else {
|
||||
} else if !self.quiet {
|
||||
print_groups(&groups);
|
||||
}
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user