diff --git a/internal/cmd/scan/scan.go b/internal/cmd/scan/scan.go index ed5777c5..98d4c97a 100644 --- a/internal/cmd/scan/scan.go +++ b/internal/cmd/scan/scan.go @@ -39,6 +39,7 @@ var versionHint bool var sbom string var sbomOutput string var tagCommitAsRelease bool +var experimental bool const ( BranchFlag = "branch" @@ -66,6 +67,7 @@ const ( SBOMOutputFlag = "sbom-output" TagCommitAsReleaseFlag = "tag-commit-as-release" TagCommitAsReleaseEnv = "TAG_COMMIT_AS_RELEASE" + ExperimentalFlag = "experimental-value" ) var scanCmdError error @@ -83,6 +85,7 @@ If the given path contains a git repository all flags but "integration" will be return RunE(&scanner)(cmd, args) }, } + cmd.Flags().StringVarP(&repositoryName, RepositoryFlag, "r", "", "repository name") cmd.Flags().StringVarP(&commitName, CommitFlag, "c", "", "commit hash") cmd.Flags().StringVarP(&branchName, BranchFlag, "b", "", "branch name") @@ -141,6 +144,12 @@ $ debricked scan . --include '**/node_modules/**'`) "\nExample:\n$ debricked scan . --version-hint=false", }, "\n") cmd.Flags().BoolVar(&versionHint, VersionHintFlag, true, versionHintDoc) + experimentalFlagDoc := strings.Join( + []string{ + "This flag allows inclusion of repository matches", + "\nExample:\n$ debricked scan . --experimental-flag=false", + }, "\n") + cmd.Flags().BoolVar(&experimental, ExperimentalFlag, false, experimentalFlagDoc) verboseDoc := strings.Join( []string{ "This flag allows you to reduce error output for resolution.", @@ -236,7 +245,9 @@ func RunE(s *scan.IScanner) func(_ *cobra.Command, args []string) error { CallGraphGenerateTimeout: viper.GetInt(CallGraphGenerateTimeoutFlag), MinFingerprintContentLength: viper.GetInt(MinFingerprintContentLengthFlag), TagCommitAsRelease: tagCommitAsRelease, + Experimental: viper.GetBool(ExperimentalFlag), } + //fmt.print("The Experimental flag value is "+options); if s != nil { scanCmdError = (*s).Scan(options) } else {