Add command to install shell completion #309

Merged
6543 merged 10 commits from noerw/tea:shell-completion into master 2020-12-16 16:02:00 +00:00
3 changed files with 4 additions and 23 deletions
Showing only changes of commit e88d2896d5 - Show all commits

View File

@ -2,7 +2,7 @@
// Use of this source code is governed by a MIT-style
// license that can be found in the LICENSE file.
package meta
package cmd
import (
"fmt"
@ -17,7 +17,8 @@ import (
// CmdAutocomplete manages autocompletion
var CmdAutocomplete = cli.Command{
Name: "autocomplete",
Name: "shellcompletion",
Aliases: []string{"autocomplete"},
Usage: "Install shell completion for tea",
Description: "Install shell completion for tea",
ArgsUsage: "<shell type> (bash, zsh, powershell)",

View File

@ -1,20 +0,0 @@
// Copyright 2020 The Gitea Authors. All rights reserved.
// Use of this source code is governed by a MIT-style
// license that can be found in the LICENSE file.
package cmd
import (
"code.gitea.io/tea/cmd/meta"
"github.com/urfave/cli/v2"
)
// CmdMeta represents a sub command
var CmdMeta = cli.Command{
Name: "meta",
Usage: "Operations on tea itself",
Description: `Operations on tea itself`,
Subcommands: []*cli.Command{
&meta.CmdAutocomplete,
},
}

View File

@ -40,7 +40,7 @@ func main() {
&cmd.CmdNotifications,
&cmd.CmdMilestones,
&cmd.CmdOrgs,
&cmd.CmdMeta,
&cmd.CmdAutocomplete,
}
app.EnableBashCompletion = true
err := app.Run(os.Args)