mirror of
https://github.com/rustic-rs/rustic.git
synced 2025-10-26 11:18:51 +00:00
group-by: default to host,label,path
This commit is contained in:
parent
256fcadb5c
commit
fb172ad09e
@ -31,7 +31,7 @@ pub(super) struct Opts {
|
||||
#[merge(strategy = merge::bool::overwrite_false)]
|
||||
dry_run: bool,
|
||||
|
||||
/// Group snapshots by any combination of host,label,paths,tags to find a suitable parent (default: host,paths)
|
||||
/// Group snapshots by any combination of host,label,paths,tags to find a suitable parent (default: host,label,paths)
|
||||
#[clap(long, short = 'g', value_name = "CRITERION")]
|
||||
group_by: Option<SnapshotGroupCriterion>,
|
||||
|
||||
@ -218,7 +218,7 @@ pub(super) fn execute(
|
||||
&snap,
|
||||
&opts
|
||||
.group_by
|
||||
.unwrap_or_else(|| SnapshotGroupCriterion::from_str("host,paths").unwrap()),
|
||||
.unwrap_or_else(|| SnapshotGroupCriterion::from_str("host,label,paths").unwrap()),
|
||||
);
|
||||
|
||||
let parent = match (backup_stdin, opts.force, opts.parent.clone()) {
|
||||
|
||||
@ -41,7 +41,7 @@ pub(super) struct Opts {
|
||||
#[clap(global_setting(AppSettings::DeriveDisplayOrder))]
|
||||
#[serde(default, rename_all = "kebab-case")]
|
||||
struct ConfigOpts {
|
||||
/// Group snapshots by any combination of host,label,paths,tags (default: "host,paths")
|
||||
/// Group snapshots by any combination of host,label,paths,tags (default: "host,label,paths")
|
||||
#[clap(long, short = 'g', value_name = "CRITERION")]
|
||||
#[serde_as(as = "Option<DisplayFromStr>")]
|
||||
group_by: Option<SnapshotGroupCriterion>,
|
||||
@ -70,7 +70,7 @@ pub(super) fn execute(
|
||||
let group_by = opts
|
||||
.config
|
||||
.group_by
|
||||
.unwrap_or_else(|| SnapshotGroupCriterion::from_str("host,paths").unwrap());
|
||||
.unwrap_or_else(|| SnapshotGroupCriterion::from_str("host,label,paths").unwrap());
|
||||
|
||||
let groups = match opts.ids.is_empty() {
|
||||
true => SnapshotFile::group_from_backend(be, &opts.config.filter, &group_by)?,
|
||||
|
||||
@ -22,7 +22,7 @@ pub(super) struct Opts {
|
||||
long,
|
||||
short = 'g',
|
||||
value_name = "CRITERION",
|
||||
default_value = "host,paths"
|
||||
default_value = "host,label,paths"
|
||||
)]
|
||||
group_by: SnapshotGroupCriterion,
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user