generate man pages via sub command
Signed-off-by: Christian Goll <cgoll@suse.de>
This commit is contained in:
@@ -6,18 +6,18 @@ import (
|
||||
"github.com/spf13/cobra"
|
||||
)
|
||||
|
||||
func CobraRunE(cmd *cobra.Command, args []string) error {
|
||||
func CobraRunE(cmd *cobra.Command, args []string) (err error) {
|
||||
myArg := "bash"
|
||||
if len(args) == 1 {
|
||||
myArg = args[0]
|
||||
}
|
||||
switch myArg {
|
||||
case "zsh":
|
||||
cmd.GenZshCompletion(os.Stdout)
|
||||
err = cmd.Parent().Parent().GenZshCompletion(os.Stdout)
|
||||
case "fish":
|
||||
cmd.GenFishCompletion(os.Stdout, true)
|
||||
err = cmd.Parent().Parent().GenFishCompletion(os.Stdout, true)
|
||||
default:
|
||||
cmd.GenBashCompletion(os.Stdout)
|
||||
err = cmd.Parent().Parent().GenBashCompletion(os.Stdout)
|
||||
}
|
||||
return nil
|
||||
return
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user