mirror of
https://github.com/restic/restic.git
synced 2025-03-16 00:00:05 +01:00
Fix if function and adds error handling
This commit is contained in:
parent
38d95a12a2
commit
f83fa24467
1 changed files with 7 additions and 4 deletions
|
@ -85,11 +85,14 @@ func runSnapshots(opts SnapshotOptions, gopts GlobalOptions, args []string) erro
|
|||
|
||||
}
|
||||
|
||||
if gopts.JSON == true {
|
||||
jsonoutput(list)
|
||||
} else {
|
||||
naturaloutput(list)
|
||||
if gopts.JSON {
|
||||
err := jsonoutput(list)
|
||||
if err != nil {
|
||||
fmt.Fprintf(os.Stderr, "error printing snapshot: %v\n", err)
|
||||
}
|
||||
return nil
|
||||
}
|
||||
naturaloutput(list)
|
||||
|
||||
return nil
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue