Skip to content

Commit

Permalink
add additional options
Browse files Browse the repository at this point in the history
  • Loading branch information
emilwareus committed Jan 5, 2024
1 parent 32c76be commit 91cc7d2
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions internal/cmd/resolve/resolve.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down Expand Up @@ -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)
Expand Down

0 comments on commit 91cc7d2

Please sign in to comment.