From 91cc7d2b1947979a066f7bf9814d38ea2cfcab9c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Emil=20W=C3=A5reus?= Date: Fri, 5 Jan 2024 15:08:24 +0100 Subject: [PATCH] add additional options --- internal/cmd/resolve/resolve.go | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/internal/cmd/resolve/resolve.go b/internal/cmd/resolve/resolve.go index 3da87e1b..140e108c 100644 --- a/internal/cmd/resolve/resolve.go +++ b/internal/cmd/resolve/resolve.go @@ -20,11 +20,11 @@ var ( ) const ( - ExclusionFlag = "exclusion" - VerboseFlag = "verbose" - NpmPreferredFlag = "prefer-npm" - RegenerateFlag = "regenerate" - StrictFlag = "strict" + ExclusionFlag = "exclusion" + VerboseFlag = "verbose" + NpmPreferredFlag = "prefer-npm" + RegenerateFlag = "regenerate" + ResolutionStrictFlag = "resolution-strictness" ) func NewResolveCmd(resolver resolution.IResolver) *cobra.Command { @@ -81,12 +81,13 @@ $ debricked resolve . `+exampleFlags) cmd.Flags().BoolP(NpmPreferredFlag, "", npmPreferred, npmPreferredDoc) - cmd.Flags().IntVarP(&strictness, StrictFlag, "s", file.StrictAll, `Allows you to configure exit code 1 or 0 depending on if the resolution was successful or not. + cmd.Flags().IntVarP(&strictness, ResolutionStrictFlag, "s", file.StrictAll, `Allows you to configure exit code 1 or 0 depending on if the resolution was successful or not. Strictness Level | Meaning ---------------- | ------- 0 (default) | Always exit with code 0, even if any or all files failed to resolve 1 | Exit with code 1 if all files failed to resolve, otherwise exit with code 0 2 | Exit with code 1 if any file failed to resolve, otherwise exit with code 0 +3 | Exit with code 1 if all files failed to resolve, if any but not all files failed to resolve exit with code 3, otherwise exit with code 0 `) viper.MustBindEnv(ExclusionFlag)