From c39e7640e2a2d71b4b12fbc5293be400e3122558 Mon Sep 17 00:00:00 2001 From: Zachary Rice Date: Tue, 11 Oct 2022 07:11:02 -0500 Subject: [PATCH] define log-opts, odd that this wasn't failing before... (#1009) --- cmd/protect.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/cmd/protect.go b/cmd/protect.go index 434d6843..36007fa0 100644 --- a/cmd/protect.go +++ b/cmd/protect.go @@ -16,6 +16,7 @@ import ( func init() { protectCmd.Flags().Bool("staged", false, "detect secrets in a --staged state") + protectCmd.Flags().String("log-opts", "", "git log options") rootCmd.AddCommand(protectCmd) } @@ -66,6 +67,10 @@ func runProtect(cmd *cobra.Command, args []string) { log.Fatal().Err(err).Msg("") } + if detector.MaxTargetMegaBytes, err = cmd.Flags().GetInt("max-target-megabytes"); err != nil { + log.Fatal().Err(err).Msg("") + } + // get log options for git scan logOpts, err := cmd.Flags().GetString("log-opts") if err != nil {