From b659f1517f4869a110ee4e85ff6077ba508c28cd Mon Sep 17 00:00:00 2001 From: Alan Silva Date: Wed, 5 Aug 2020 21:40:01 -0400 Subject: [PATCH] Updated deps to use addOutputFormat function Signed-off-by: Alan Silva --- cmd/deps.go | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/cmd/deps.go b/cmd/deps.go index 766d3bd74d..89759a6e03 100644 --- a/cmd/deps.go +++ b/cmd/deps.go @@ -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 ( @@ -35,7 +35,7 @@ func init() { var params depsCommandParams - params.format = util.NewEnumFlag(depsFormatPretty, []string{ + params.outputFormat = util.NewEnumFlag(depsFormatPretty, []string{ depsFormatPretty, depsFormatJSON, }) @@ -56,10 +56,10 @@ func init() { }, } - depsCommand.Flags().VarP(params.format, "format", "f", "set output format") addIgnoreFlag(depsCommand.Flags(), ¶ms.ignore) addDataFlag(depsCommand.Flags(), ¶ms.dataPaths) addBundleFlag(depsCommand.Flags(), ¶ms.bundlePaths) + addOutputFormat(depsCommand.Flags(), params.outputFormat) RootCommand.AddCommand(depsCommand) } @@ -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: