Skip to content

Commit

Permalink
Fix help message outputs. (#366)
Browse files Browse the repository at this point in the history
Signed-off-by: Dan Lorenc <dlorenc@google.com>
  • Loading branch information
dlorenc authored Jul 11, 2021
1 parent 5862799 commit cb96bc0
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 8 deletions.
1 change: 0 additions & 1 deletion cmd/rekor-cli/app/timestamp.go
Original file line number Diff line number Diff line change
Expand Up @@ -197,7 +197,6 @@ var timestampCmd = &cobra.Command{
}
if err := validateTimestampFlags(); err != nil {
log.Logger.Error(err)
_ = cmd.Help()
return err
}
return nil
Expand Down
10 changes: 4 additions & 6 deletions cmd/rekor-cli/app/upload.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ import (
"crypto/ecdsa"
"crypto/sha256"
"fmt"
"os"

"github.com/cyberphone/json-canonicalization/go/src/webpki.org/jsoncanonicalizer"
"github.com/go-openapi/swag"
Expand Down Expand Up @@ -54,16 +53,15 @@ func (u *uploadCmdOutput) String() string {
var uploadCmd = &cobra.Command{
Use: "upload",
Short: "Upload an artifact to Rekor",
PreRun: func(cmd *cobra.Command, args []string) {
PreRunE: func(cmd *cobra.Command, args []string) error {
// these are bound here so that they are not overwritten by other commands
if err := viper.BindPFlags(cmd.Flags()); err != nil {
log.Logger.Fatal("Error initializing cmd line args: ", err)
return err
}
if err := validateArtifactPFlags(false, false); err != nil {
log.Logger.Error(err)
_ = cmd.Help()
os.Exit(1)
return err
}
return nil
},
Long: `This command takes the public key, signature and URL of the release artifact and uploads it to the rekor server.`,
Run: format.WrapCmd(func(args []string) (interface{}, error) {
Expand Down
1 change: 0 additions & 1 deletion cmd/rekor-cli/app/verify.go
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,6 @@ var verifyCmd = &cobra.Command{
return fmt.Errorf("error initializing cmd line args: %s", err)
}
if err := validateArtifactPFlags(true, true); err != nil {
_ = cmd.Help()
return err
}
return nil
Expand Down

0 comments on commit cb96bc0

Please sign in to comment.