Skip to content

Commit

Permalink
style: addressed pr comments
Browse files Browse the repository at this point in the history
  • Loading branch information
JulesFaucherre authored and AbrahamTewa committed Dec 16, 2022
1 parent d09b3de commit fdce758
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions cmd/orb.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ import (
"github.com/fatih/color"
"github.com/pkg/errors"
"github.com/spf13/cobra"
"golang.org/x/exp/slices"
"gopkg.in/yaml.v3"

"github.com/AlecAivazis/survey/v2"
Expand Down Expand Up @@ -337,7 +338,7 @@ Please note that at this time all orbs created in the registry are world-readabl
Annotations: make(map[string]string),
}
orbDiff.Annotations["<orb>"] = "An orb with only a namespace and a name. This takes this form namespace/orb"
orbDiff.PersistentFlags().StringVar(&opts.color, "color", "auto", "Show colored diff. Can be one of always, never, or auto")
orbDiff.PersistentFlags().StringVar(&opts.color, "color", "auto", "Show colored diff. Can be one of \"always\", \"never\", or \"auto\"")

orbCreate.Flags().BoolVar(&opts.integrationTesting, "integration-testing", false, "Enable test mode to bypass interactive UI.")
if err := orbCreate.Flags().MarkHidden("integration-testing"); err != nil {
Expand Down Expand Up @@ -1632,7 +1633,8 @@ func orbTemplate(fileContents string, projectName string, orgName string, orbNam

func orbDiff(opts orbOptions) error {
colorOpt := opts.color
if colorOpt != "auto" && colorOpt != "always" && colorOpt != "never" {
allowedColorOpts := []string{"auto", "always", "never"}
if !slices.Contains(allowedColorOpts, colorOpt) {
return fmt.Errorf("option `color' expects \"always\", \"auto\", or \"never\"")
}

Expand Down

0 comments on commit fdce758

Please sign in to comment.