-
Notifications
You must be signed in to change notification settings - Fork 72
/
completion.go
30 lines (25 loc) · 900 Bytes
/
completion.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
package completion
import (
"github.com/spf13/cobra"
"github.com/redhat-developer/app-services-cli/pkg/cmd/completion/bash"
"github.com/redhat-developer/app-services-cli/pkg/cmd/completion/fish"
"github.com/redhat-developer/app-services-cli/pkg/cmd/completion/powershell"
"github.com/redhat-developer/app-services-cli/pkg/cmd/completion/zsh"
"github.com/redhat-developer/app-services-cli/pkg/shared/factory"
)
func NewCompletionCommand(f *factory.Factory) *cobra.Command {
cmd := &cobra.Command{
Use: "completion",
Short: f.Localizer.MustLocalize("completion.cmd.shortDescription"),
Long: f.Localizer.MustLocalize("completion.cmd.longDescription"),
Example: f.Localizer.MustLocalize("completion.cmd.example"),
Args: cobra.ExactArgs(1),
}
cmd.AddCommand(
bash.NewCommand(f),
zsh.NewCommand(f),
fish.NewCommand(f),
powershell.NewCommand(f),
)
return cmd
}