mirror of
https://github.com/woodpecker-ci/woodpecker.git
synced 2026-02-13 21:00:00 +00:00
Enable completion support for cli (#5552)
Co-authored-by: Robert Kaussow <mail@thegeeklab.de>
This commit is contained in:
@@ -31,7 +31,7 @@ func (c *Config) MergeIfNotSet(c2 *Config) {
|
||||
}
|
||||
}
|
||||
|
||||
var skipSetupForCommands = []string{"setup", "help", "h", "version", "update", "lint", "exec", ""}
|
||||
var skipSetupForCommands = []string{"setup", "help", "h", "version", "update", "lint", "exec", "completion", ""}
|
||||
|
||||
func Load(ctx context.Context, c *cli.Command) error {
|
||||
if firstArg := c.Args().First(); slices.Contains(skipSetupForCommands, firstArg) {
|
||||
|
||||
@@ -41,6 +41,10 @@ func newApp() *cli.Command {
|
||||
app.Before = common.Before
|
||||
app.After = common.After
|
||||
app.Suggest = true
|
||||
app.ConfigureShellCompletionCommand = func(c *cli.Command) {
|
||||
c.Hidden = false
|
||||
c.Usage = "generate completion script for the specified shell"
|
||||
}
|
||||
app.Commands = []*cli.Command{
|
||||
admin.Command,
|
||||
exec.Command,
|
||||
|
||||
Reference in New Issue
Block a user