Skip to content

Commit

Permalink
Updated deps to use addOutputFormat function
Browse files Browse the repository at this point in the history
Signed-off-by: Alan Silva <alansq16@gmail.com>
  • Loading branch information
OmegaVVeapon authored and tsandall committed Aug 6, 2020
1 parent 64a2723 commit b659f15
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions cmd/deps.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,10 @@ import (
)

type depsCommandParams struct {
dataPaths repeatedStringFlag
format *util.EnumFlag
ignore []string
bundlePaths repeatedStringFlag
dataPaths repeatedStringFlag
outputFormat *util.EnumFlag
ignore []string
bundlePaths repeatedStringFlag
}

const (
Expand All @@ -35,7 +35,7 @@ func init() {

var params depsCommandParams

params.format = util.NewEnumFlag(depsFormatPretty, []string{
params.outputFormat = util.NewEnumFlag(depsFormatPretty, []string{
depsFormatPretty, depsFormatJSON,
})

Expand All @@ -56,10 +56,10 @@ func init() {
},
}

depsCommand.Flags().VarP(params.format, "format", "f", "set output format")
addIgnoreFlag(depsCommand.Flags(), &params.ignore)
addDataFlag(depsCommand.Flags(), &params.dataPaths)
addBundleFlag(depsCommand.Flags(), &params.bundlePaths)
addOutputFormat(depsCommand.Flags(), params.outputFormat)

RootCommand.AddCommand(depsCommand)
}
Expand Down Expand Up @@ -123,7 +123,7 @@ func deps(args []string, params depsCommandParams) error {
Virtual: vrs,
}

switch params.format.String() {
switch params.outputFormat.String() {
case depsFormatJSON:
return presentation.JSON(os.Stdout, output)
default:
Expand Down

0 comments on commit b659f15

Please sign in to comment.