diff --git a/changelog/unreleased/issue-2330 b/changelog/unreleased/issue-2330 new file mode 100644 index 000000000..5836ab316 --- /dev/null +++ b/changelog/unreleased/issue-2330 @@ -0,0 +1,6 @@ +Enhancement: Make `--group-by` accept both singular and plural + +One can now use the values `host`/`hosts`, `path`/`paths` and +`tag` / `tags` interchangeably in the `--group-by` argument. + +https://github.com/restic/restic/issues/2330 diff --git a/internal/restic/snapshot_group.go b/internal/restic/snapshot_group.go index f18e0d767..1e5ac18ee 100644 --- a/internal/restic/snapshot_group.go +++ b/internal/restic/snapshot_group.go @@ -31,11 +31,11 @@ func GroupSnapshots(snapshots Snapshots, options string) (map[string]Snapshots, for _, option := range GroupOptionList { switch option { - case "host": + case "host", "hosts": GroupByHost = true - case "paths": + case "path", "paths": GroupByPath = true - case "tags": + case "tag", "tags": GroupByTag = true case "": default: