Skip to content

Commit

Permalink
fix(cleanup): remove vops.yaml
Browse files Browse the repository at this point in the history
  • Loading branch information
Tom Morelly committed Mar 2, 2023
1 parent 5eac0ec commit b645e67
Show file tree
Hide file tree
Showing 4 changed files with 41 additions and 17 deletions.
37 changes: 37 additions & 0 deletions cmd/completion.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
package cmd

import (
"os"

"github.com/spf13/cobra"
)

//nolint
func completionCmd() *cobra.Command {
cmd := &cobra.Command{
Use: "completion",
Short: "Generate completion script",
SilenceUsage: true,
DisableFlagsInUseLine: true,
Hidden: true,
Args: cobra.MatchAll(cobra.ExactArgs(1), cobra.OnlyValidArgs),
PersistentPreRunE: func(cmd *cobra.Command, args []string) error {
return nil
},
ValidArgs: []string{"bash", "zsh", "fish", "powershell"},
Run: func(cmd *cobra.Command, args []string) {
switch args[0] {
case "bash":
cmd.Root().GenBashCompletion(os.Stdout)
case "zsh":
cmd.Root().GenZshCompletion(os.Stdout)
case "fish":
cmd.Root().GenFishCompletion(os.Stdout, true)
case "powershell":
cmd.Root().GenPowerShellCompletionWithDesc(os.Stdout)
}
},
}

return cmd
}
3 changes: 3 additions & 0 deletions cmd/manpage.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,9 @@ func manCmd() *ManCmd {
DisableFlagsInUseLine: true,
Hidden: true,
Args: cobra.NoArgs,
PersistentPreRunE: func(cmd *cobra.Command, args []string) error {
return nil
},
RunE: func(cmd *cobra.Command, args []string) error {
manPage, err := mcoral.NewManPage(1, root.Cmd.Root())
if err != nil {
Expand Down
1 change: 1 addition & 0 deletions cmd/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@ func NewRootCmd(v string, writer io.Writer) *cobra.Command {
uiCmd(),
loginCmd(),
tokenCmd(),
completionCmd(),
)

return cmd
Expand Down
17 changes: 0 additions & 17 deletions cmd/vops.yml

This file was deleted.

0 comments on commit b645e67

Please sign in to comment.