Skip to content

Commit

Permalink
suppress usage for execution errors
Browse files Browse the repository at this point in the history
Signed-off-by: Avi Deitcher <[email protected]>
  • Loading branch information
deitch committed Mar 26, 2024
1 parent c526e6c commit 54b94f4
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
2 changes: 2 additions & 0 deletions cmd/dump.go
Original file line number Diff line number Diff line change
Expand Up @@ -181,6 +181,8 @@ func dumpCmd(execs execs, cmdConfig *cmdConfiguration) (*cobra.Command, error) {
prune = execs.prune
timer = execs.timer
}
// at this point, any errors should not have usage
cmd.SilenceUsage = true
if err := timer(timerOpts, func() error {
err := dump(dumpOpts)
if err != nil {
Expand Down
2 changes: 2 additions & 0 deletions cmd/restore.go
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,8 @@ func restoreCmd(execs execs, cmdConfig *cmdConfiguration) (*cobra.Command, error
if execs != nil {
restore = execs.restore
}
// at this point, any errors should not have usage
cmd.SilenceUsage = true
if err := restore(store, targetFile, cmdConfig.dbconn, databasesMap, compressor); err != nil {
return fmt.Errorf("error restoring: %v", err)
}
Expand Down

0 comments on commit 54b94f4

Please sign in to comment.