* showing help by basic call
All checks were successful
Build and Test / build-test (1.23.4) (push) Successful in 1m37s
All checks were successful
Build and Test / build-test (1.23.4) (push) Successful in 1m37s
* autocompletion for exec
This commit is contained in:
@@ -3,6 +3,7 @@ package exec
|
||||
import (
|
||||
"errors"
|
||||
"fmt"
|
||||
"git.denysoft.de/CubeBit/ssh-hub/util"
|
||||
"github.com/creack/pty"
|
||||
"github.com/spf13/cobra"
|
||||
"github.com/spf13/viper"
|
||||
@@ -16,6 +17,10 @@ import (
|
||||
var execCmd = &cobra.Command{
|
||||
Use: "exec",
|
||||
Short: "Execute command of specific alias",
|
||||
ValidArgsFunction: func(cmd *cobra.Command, args []string, toComplete string) ([]string, cobra.ShellCompDirective) {
|
||||
data := viper.GetStringMapString("data")
|
||||
return util.AutocompleteConfig(&data, toComplete), cobra.ShellCompDirectiveNoFileComp
|
||||
},
|
||||
Args: func(cmd *cobra.Command, args []string) error {
|
||||
if err := cobra.ExactArgs(1)(cmd, args); err != nil {
|
||||
return err
|
||||
|
||||
Reference in New Issue
Block a user