Merge pull request #2479 from rawtaz/sing-pulitzer-group

Accept both singular and plural for --group-by (#2330)
This commit is contained in:
rawtaz 2019-11-20 21:03:05 +01:00 committed by GitHub
commit 929d2b8df3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 9 additions and 3 deletions

View File

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

View File

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