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

Complete bug IDs where appropriate #531

Merged
merged 5 commits into from May 1, 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
2 changes: 2 additions & 0 deletions commands/bridge_auth_addtoken.go
Expand Up @@ -41,10 +41,12 @@ func newBridgeAuthAddTokenCommand() *cobra.Command {

flags.StringVarP(&options.target, "target", "t", "",
fmt.Sprintf("The target of the bridge. Valid values are [%s]", strings.Join(bridge.Targets(), ",")))
cmd.RegisterFlagCompletionFunc("target", completeFrom(bridge.Targets()))
flags.StringVarP(&options.login,
"login", "l", "", "The login in the remote bug-tracker")
flags.StringVarP(&options.user,
"user", "u", "", "The user to add the token to. Default is the current user")
cmd.RegisterFlagCompletionFunc("user", completeUser(env))

return cmd
}
Expand Down
3 changes: 2 additions & 1 deletion commands/bridge_auth_rm.go
Expand Up @@ -16,7 +16,8 @@ func newBridgeAuthRm() *cobra.Command {
RunE: func(cmd *cobra.Command, args []string) error {
return runBridgeAuthRm(env, args)
},
Args: cobra.ExactArgs(1),
Args: cobra.ExactArgs(1),
ValidArgsFunction: completeBridgeAuth(env),
}

return cmd
Expand Down
3 changes: 2 additions & 1 deletion commands/bridge_auth_show.go
Expand Up @@ -21,7 +21,8 @@ func newBridgeAuthShow() *cobra.Command {
RunE: closeBackend(env, func(cmd *cobra.Command, args []string) error {
return runBridgeAuthShow(env, args)
}),
Args: cobra.ExactArgs(1),
Args: cobra.ExactArgs(1),
ValidArgsFunction: completeBridgeAuth(env),
}

return cmd
Expand Down
1 change: 1 addition & 0 deletions commands/bridge_configure.go
Expand Up @@ -97,6 +97,7 @@ git bug bridge configure \
flags.StringVarP(&options.name, "name", "n", "", "A distinctive name to identify the bridge")
flags.StringVarP(&options.target, "target", "t", "",
fmt.Sprintf("The target of the bridge. Valid values are [%s]", strings.Join(bridge.Targets(), ",")))
cmd.RegisterFlagCompletionFunc("target", completeFrom(bridge.Targets()))
flags.StringVarP(&options.params.URL, "url", "u", "", "The URL of the remote repository")
flags.StringVarP(&options.params.BaseURL, "base-url", "b", "", "The base URL of your remote issue tracker")
flags.StringVarP(&options.params.Login, "login", "l", "", "The login on your remote issue tracker")
Expand Down
3 changes: 2 additions & 1 deletion commands/bridge_pull.go
Expand Up @@ -32,7 +32,8 @@ func newBridgePullCommand() *cobra.Command {
RunE: closeBackend(env, func(cmd *cobra.Command, args []string) error {
return runBridgePull(env, options, args)
}),
Args: cobra.MaximumNArgs(1),
Args: cobra.MaximumNArgs(1),
ValidArgsFunction: completeBridge(env),
}

flags := cmd.Flags()
Expand Down
3 changes: 2 additions & 1 deletion commands/bridge_push.go
Expand Up @@ -23,7 +23,8 @@ func newBridgePushCommand() *cobra.Command {
RunE: closeBackend(env, func(cmd *cobra.Command, args []string) error {
return runBridgePush(env, args)
}),
Args: cobra.MaximumNArgs(1),
Args: cobra.MaximumNArgs(1),
ValidArgsFunction: completeBridge(env),
}

return cmd
Expand Down
3 changes: 2 additions & 1 deletion commands/bridge_rm.go
Expand Up @@ -16,7 +16,8 @@ func newBridgeRm() *cobra.Command {
RunE: closeBackend(env, func(cmd *cobra.Command, args []string) error {
return runBridgeRm(env, args)
}),
Args: cobra.ExactArgs(1),
Args: cobra.ExactArgs(1),
ValidArgsFunction: completeBridge(env),
}

return cmd
Expand Down
1 change: 1 addition & 0 deletions commands/comment.go
Expand Up @@ -18,6 +18,7 @@ func newCommentCommand() *cobra.Command {
RunE: closeBackend(env, func(cmd *cobra.Command, args []string) error {
return runComment(env, args)
}),
ValidArgsFunction: completeBug(env),
}

cmd.AddCommand(newCommentAddCommand())
Expand Down
1 change: 1 addition & 0 deletions commands/comment_add.go
Expand Up @@ -25,6 +25,7 @@ func newCommentAddCommand() *cobra.Command {
RunE: closeBackend(env, func(cmd *cobra.Command, args []string) error {
return runCommentAdd(env, options, args)
}),
ValidArgsFunction: completeBug(env),
}

flags := cmd.Flags()
Expand Down