Skip to content
Snippets Groups Projects
Unverified Commit cb96bc0c authored by dlorenc's avatar dlorenc Committed by GitHub
Browse files

Fix help message outputs. (#366)


Signed-off-by: default avatarDan Lorenc <dlorenc@google.com>
parent 58627992
No related branches found
No related tags found
No related merge requests found
......@@ -197,7 +197,6 @@ var timestampCmd = &cobra.Command{
}
if err := validateTimestampFlags(); err != nil {
log.Logger.Error(err)
_ = cmd.Help()
return err
}
return nil
......
......@@ -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"
......@@ -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) {
......
......@@ -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
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment