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

fix: annotate flags so they complete better #3444

Merged
merged 2 commits into from Oct 6, 2022
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.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
1 change: 1 addition & 0 deletions cmd/build.go
Expand Up @@ -81,6 +81,7 @@ When using ` + "`--single-target`" + `, the ` + "`GOOS`" + ` and ` + "`GOARCH`"
cmd.Flags().StringArrayVar(&root.opts.ids, "id", nil, "Builds only the specified build ids")
cmd.Flags().BoolVar(&root.opts.deprecated, "deprecated", false, "Force print the deprecation message - tests only")
cmd.Flags().StringVarP(&root.opts.output, "output", "o", "", "Copy the binary to the path after the build. Only taken into account when using --single-target and a single id (either with --id or if configuration only has one build)")
_ = cmd.Flags().SetAnnotation("output", cobra.BashCompFilenameExt, []string{""})
_ = cmd.Flags().MarkHidden("deprecated")

root.cmd = cmd
Expand Down
1 change: 1 addition & 0 deletions cmd/release.go
Expand Up @@ -84,6 +84,7 @@ func newReleaseCmd() *releaseCmd {
cmd.Flags().DurationVar(&root.opts.timeout, "timeout", 30*time.Minute, "Timeout to the entire release process")
cmd.Flags().BoolVar(&root.opts.deprecated, "deprecated", false, "Force print the deprecation message - tests only")
_ = cmd.Flags().MarkHidden("deprecated")
_ = cmd.Flags().SetAnnotation("config", cobra.BashCompFilenameExt, []string{"yaml", "yml"})

root.cmd = cmd
return root
Expand Down
3 changes: 2 additions & 1 deletion cmd/schema.go
Expand Up @@ -47,7 +47,8 @@ func newSchemaCmd() *schemaCmd {
},
}

cmd.Flags().StringVarP(&root.output, "output", "o", "-", "where to save the json schema")
cmd.Flags().StringVarP(&root.output, "output", "o", "-", "Where to save the JSONSchema file")
_ = cmd.Flags().SetAnnotation("output", cobra.BashCompFilenameExt, []string{"json"})

root.cmd = cmd
return root
Expand Down