group-by: default to host,label,path

This commit is contained in:
Alexander Weiss 2023-02-20 22:29:44 +01:00
parent 256fcadb5c
commit fb172ad09e
3 changed files with 5 additions and 5 deletions

View File

@ -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()) {

View File

@ -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)?,

View File

@ -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,