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

Merge pull request #246 from ahmetb/logverify-last-fix

rekor-cli: logproof -last-size default fix
parents ab72d662 7da914ce
No related branches found
No related tags found
No related merge requests found
......@@ -55,15 +55,18 @@ var logProofCmd = &cobra.Command{
if err := viper.BindPFlags(cmd.Flags()); err != nil {
return fmt.Errorf("Error initializing cmd line args: %s", err)
}
if viper.GetUint64("first-size") > viper.GetUint64("last-size") {
return errors.New("last-size must be >= to first-size")
}
if viper.GetUint64("first-size") == 0 {
return errors.New("first-size must be > 0")
}
if !viper.IsSet("last-size") {
return errors.New("last-size must be specified")
}
if viper.GetUint64("last-size") == 0 {
return errors.New("last-size must be > 0")
}
if viper.GetUint64("first-size") > viper.GetUint64("last-size") {
return errors.New("last-size must be >= to first-size")
}
return nil
},
Run: format.WrapCmd(func(args []string) (interface{}, error) {
......@@ -94,7 +97,7 @@ var logProofCmd = &cobra.Command{
func init() {
logProofCmd.Flags().Uint64("first-size", 1, "the size of the log where the proof should begin")
logProofCmd.Flags().Uint64("last-size", 1, "the size of the log where the proof should end")
logProofCmd.Flags().Uint64("last-size", 0, "the size of the log where the proof should end")
if err := logProofCmd.MarkFlagRequired("last-size"); err != nil {
fmt.Println(err)
os.Exit(1)
......
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