mirror of
https://codeberg.org/scip/tablizer.git
synced 2025-12-17 12:31:06 +01:00
check completion errors
This commit is contained in:
10
cmd/root.go
10
cmd/root.go
@@ -49,18 +49,16 @@ func man() {
|
|||||||
func completion(cmd *cobra.Command, mode string) error {
|
func completion(cmd *cobra.Command, mode string) error {
|
||||||
switch mode {
|
switch mode {
|
||||||
case "bash":
|
case "bash":
|
||||||
cmd.Root().GenBashCompletion(os.Stdout)
|
return cmd.Root().GenBashCompletion(os.Stdout)
|
||||||
case "zsh":
|
case "zsh":
|
||||||
cmd.Root().GenZshCompletion(os.Stdout)
|
return cmd.Root().GenZshCompletion(os.Stdout)
|
||||||
case "fish":
|
case "fish":
|
||||||
cmd.Root().GenFishCompletion(os.Stdout, true)
|
return cmd.Root().GenFishCompletion(os.Stdout, true)
|
||||||
case "powershell":
|
case "powershell":
|
||||||
cmd.Root().GenPowerShellCompletionWithDesc(os.Stdout)
|
return cmd.Root().GenPowerShellCompletionWithDesc(os.Stdout)
|
||||||
default:
|
default:
|
||||||
return errors.New("Invalid shell parameter! Valid ones: bash|zsh|fish|powershell")
|
return errors.New("Invalid shell parameter! Valid ones: bash|zsh|fish|powershell")
|
||||||
}
|
}
|
||||||
|
|
||||||
return nil
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func Execute() {
|
func Execute() {
|
||||||
|
|||||||
Reference in New Issue
Block a user