From bc6ba02bd84fc3bd86c61e89c16c400dfef01623 Mon Sep 17 00:00:00 2001 From: Johannes Altmanninger Date: Sun, 24 Jan 2021 14:05:40 +0100 Subject: Add command-specific argument completions Complete bug IDs, bridges, users, labels where appropriate. This works in bash and fish. ZSH is not yet supported by Cobra. In fish, descriptions (the part of a completion after the "\t") are shown as completion label, and can be searched with Ctrl+S. Reproduce with fish -C 'source misc/fish_completion/git-bug' git bug select ^I (tested with fish version 3.3.1) Also works with bash, but only for "git-bug" (with the dash) bash --rcfile <(echo source misc/bash_completion/git-bug) git-bug select ^I Closes #493 --- commands/bridge_auth_show.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'commands/bridge_auth_show.go') diff --git a/commands/bridge_auth_show.go b/commands/bridge_auth_show.go index f174cdb7..7233bb51 100644 --- a/commands/bridge_auth_show.go +++ b/commands/bridge_auth_show.go @@ -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 -- cgit