aboutsummaryrefslogtreecommitdiff
path: root/main.go
diff options
context:
space:
mode:
authorzeripath2023-02-21 17:32:24 +0000
committerGitHub2023-02-21 12:32:24 -0500
commit43405c35f07d8f6fb7c177cf599e19090020527e (patch)
treeccf1758bd4098b523282585f5e8b26365b9fa027 /main.go
parent4de5cd9f367fe73815b1c72ffc54a5118cc8e1d6 (diff)
Add Bash and Zsh completion scripts (#22646)
This PR adds contrib scripts for bash and zsh completion. Simply call: ```bash source contrib/autocompletion/bash_autocomplete ``` or for Zsh: ```bash source contrib/autocompletion/zsh_autocomplete ``` Signed-off-by: Andrew Thornton <art27@cantab.net> --------- Signed-off-by: Andrew Thornton <art27@cantab.net> Co-authored-by: a1012112796 <1012112796@qq.com> Co-authored-by: techknowlogick <techknowlogick@gitea.io>
Diffstat (limited to 'main.go')
-rw-r--r--main.go2
1 files changed, 2 insertions, 0 deletions
diff --git a/main.go b/main.go
index 4b183a768..eeedf54c2 100644
--- a/main.go
+++ b/main.go
@@ -113,6 +113,8 @@ arguments - which can alternatively be run by running the subcommand web.`
setFlagsAndBeforeOnSubcommands(&app.Commands[i], defaultFlags, establishCustomPath)
}
+ app.EnableBashCompletion = true
+
err := app.Run(os.Args)
if err != nil {
log.Fatal("Failed to run app with %s: %v", os.Args, err)