From efbbc8d7399292c95c925646f0cc09d61b753c1b Mon Sep 17 00:00:00 2001 From: filip Date: Thu, 17 Oct 2024 12:51:02 +0200 Subject: [PATCH] Minor name changes and hide experimental flag --- internal/cmd/scan/scan.go | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/internal/cmd/scan/scan.go b/internal/cmd/scan/scan.go index 3c5f9964..6127c1ac 100644 --- a/internal/cmd/scan/scan.go +++ b/internal/cmd/scan/scan.go @@ -67,7 +67,7 @@ const ( SBOMOutputFlag = "sbom-output" TagCommitAsReleaseFlag = "tag-commit-as-release" TagCommitAsReleaseEnv = "TAG_COMMIT_AS_RELEASE" - ExperimentalFlag = "experimental-value" + ExperimentalFlag = "experimental" ) var scanCmdError error @@ -147,7 +147,7 @@ $ debricked scan . --include '**/node_modules/**'`) experimentalFlagDoc := strings.Join( []string{ "This flag allows inclusion of repository matches", - "\nExample:\n$ debricked scan . --experimental-flag=false", + "\nExample:\n$ debricked scan . --experimental=false", }, "\n") cmd.Flags().BoolVar(&experimental, ExperimentalFlag, false, experimentalFlagDoc) verboseDoc := strings.Join( @@ -195,6 +195,12 @@ Leaving the field empty results in no SBOM generation.`, viper.MustBindEnv(SBOMOutputFlag) viper.MustBindEnv(TagCommitAsReleaseFlag) + // Hide experimental flag + err := cmd.Flags().MarkHidden(ExperimentalFlag) + if err != nil { // This should not be reachable + fmt.Println("Trying to hide non-existing flag") + } + return cmd }