mirror of https://github.com/restic/restic.git
backup: return normal error if --group-by cannot be parsed
Co-authored-by: greatroar <61184462+greatroar@users.noreply.github.com>
This commit is contained in:
parent
f9850b79b5
commit
a013014c24
|
@ -2,10 +2,9 @@ package restic
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"encoding/json"
|
"encoding/json"
|
||||||
|
"fmt"
|
||||||
"sort"
|
"sort"
|
||||||
"strings"
|
"strings"
|
||||||
|
|
||||||
"github.com/restic/restic/internal/errors"
|
|
||||||
)
|
)
|
||||||
|
|
||||||
type SnapshotGroupByOptions struct {
|
type SnapshotGroupByOptions struct {
|
||||||
|
@ -26,7 +25,7 @@ func splitSnapshotGroupBy(s string) (SnapshotGroupByOptions, error) {
|
||||||
l.Tag = true
|
l.Tag = true
|
||||||
case "":
|
case "":
|
||||||
default:
|
default:
|
||||||
return SnapshotGroupByOptions{}, errors.Fatal("unknown grouping option: '" + option + "'")
|
return SnapshotGroupByOptions{}, fmt.Errorf("unknown grouping option: %q", option)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return l, nil
|
return l, nil
|
||||||
|
|
Loading…
Reference in New Issue