Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Changing opa cli flag descriptions to match online docs #2587

Merged
merged 3 commits into from
Aug 6, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 9 additions & 9 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")
depsCommand.Flags().VarP(&params.dataPaths, "data", "d", "set data file(s) or directory path(s)")
depsCommand.Flags().VarP(&params.bundlePaths, "bundle", "b", "set bundle file(s) or directory path(s)")
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
6 changes: 3 additions & 3 deletions cmd/flags.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,11 +31,11 @@ func addFailFlag(fs *pflag.FlagSet, fail *bool, value bool) {
}

func addDataFlag(fs *pflag.FlagSet, paths *repeatedStringFlag) {
fs.VarP(paths, "data", "d", "set data file(s) or directory path(s)")
fs.VarP(paths, "data", "d", "set policy or data file(s). This flag can be repeated.")
}

func addBundleFlag(fs *pflag.FlagSet, paths *repeatedStringFlag) {
fs.VarP(paths, "bundle", "b", "set bundle file(s) or directory path(s)")
fs.VarP(paths, "bundle", "b", "set bundle file(s) or directory path(s). This flag can be repeated.")
}

func addBundleModeFlag(fs *pflag.FlagSet, bundle *bool, value bool) {
Expand All @@ -47,7 +47,7 @@ func addInputFlag(fs *pflag.FlagSet, inputPath *string) {
}

func addImportFlag(fs *pflag.FlagSet, imports *repeatedStringFlag) {
fs.VarP(imports, "import", "", "set query import(s)")
fs.VarP(imports, "import", "", "set query import(s). This flag can be repeated.")
}

func addPackageFlag(fs *pflag.FlagSet, pkg *string) {
Expand Down