k3s/pkg/cli/cmds/completion.go
Derek Nola 3e5561daca
Add new k3s completion command for shell completion (#5461)
* Add shell completion CLI 
Signed-off-by: Derek Nola <derek.nola@suse.com>
2022-04-29 12:53:34 -07:00

21 lines
428 B
Go

package cmds
import (
"github.com/urfave/cli"
)
func NewCompletionCommand(action func(*cli.Context) error) cli.Command {
return cli.Command{
Name: "completion",
Usage: "Install shell completion script",
UsageText: appName + " completion [SHELL] (valid shells: bash, zsh)",
Action: action,
Flags: []cli.Flag{
cli.BoolFlag{
Name: "i",
Usage: "Install source line to rc file",
},
},
}
}