forked from TrueCloudLab/restic
restore: Improve error message for more than one ID
This commit is contained in:
parent
180741609e
commit
92316a9853
1 changed files with 4 additions and 1 deletions
|
@ -53,8 +53,11 @@ func init() {
|
||||||
func runRestore(opts RestoreOptions, gopts GlobalOptions, args []string) error {
|
func runRestore(opts RestoreOptions, gopts GlobalOptions, args []string) error {
|
||||||
ctx := gopts.ctx
|
ctx := gopts.ctx
|
||||||
|
|
||||||
if len(args) != 1 {
|
switch {
|
||||||
|
case len(args) == 0:
|
||||||
return errors.Fatal("no snapshot ID specified")
|
return errors.Fatal("no snapshot ID specified")
|
||||||
|
case len(args) > 1:
|
||||||
|
return errors.Fatalf("more than one snapshot ID specified: %v", args)
|
||||||
}
|
}
|
||||||
|
|
||||||
if opts.Target == "" {
|
if opts.Target == "" {
|
||||||
|
|
Loading…
Reference in a new issue