Skip to content

Commit

Permalink
Fix: do not prompt client help on server side error
Browse files Browse the repository at this point in the history
  • Loading branch information
suizman authored and iknite committed Feb 19, 2019
1 parent 9677076 commit 2618bf4
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 2 deletions.
3 changes: 2 additions & 1 deletion cmd/client_add.go
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,8 @@ func newAddCommand(ctx *clientContext, clientPreRun func(*cobra.Command, []strin
},
RunE: func(cmd *cobra.Command, args []string) error {
log.Infof("Adding key [ %s ] with value [ %s ]\n", key, value)

// SilenceUsage is set to true -> https://github.com/spf13/cobra/issues/340
cmd.SilenceUsage = true
snapshot, err := ctx.client.Add(key)
if err != nil {
return err
Expand Down
3 changes: 2 additions & 1 deletion cmd/client_incremental.go
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,8 @@ func newIncrementalCommand(ctx *clientContext, clientPreRun func(*cobra.Command,
},
RunE: func(cmd *cobra.Command, args []string) error {
log.Infof("Querying incremental between versions [ %d ] and [ %d ]\n", start, end)

// SilenceUsage is set to true -> https://github.com/spf13/cobra/issues/340
cmd.SilenceUsage = true
proof, err := ctx.client.Incremental(start, end)
if err != nil {
return err
Expand Down
2 changes: 2 additions & 0 deletions cmd/client_membership.go
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,8 @@ func newMembershipCommand(ctx *clientContext, clientPreRun func(*cobra.Command,
var membershipResult *protocol.MembershipResult
var digest hashing.Digest
var err error
// SilenceUsage is set to true -> https://github.com/spf13/cobra/issues/340
cmd.SilenceUsage = true

if eventDigest == "" {
log.Debugf("Querying key [ %s ] with version [ %d ]\n", key, version)
Expand Down

0 comments on commit 2618bf4

Please sign in to comment.