21 lines
746 B
Go
21 lines
746 B
Go
|
package cmd
|
||
|
|
||
|
import "github.com/spf13/cobra"
|
||
|
|
||
|
func validProjectsFunc(cmd *cobra.Command, args []string, toComplete string) (
|
||
|
[]string, cobra.ShellCompDirective) {
|
||
|
return cache.ProjectStrings(), cobra.ShellCompDirectiveDefault
|
||
|
}
|
||
|
|
||
|
func validAliasesFunc(cmd *cobra.Command, args []string, toComplete string) (
|
||
|
[]string, cobra.ShellCompDirective) {
|
||
|
return cache.AliasStrings(), cobra.ShellCompDirectiveDefault
|
||
|
}
|
||
|
|
||
|
func validProjectsOrAliasesFunc(cmd *cobra.Command, args []string, toComplete string) (
|
||
|
[]string, cobra.ShellCompDirective) {
|
||
|
projectStrings, _ := validAliasesFunc(cmd, args, toComplete)
|
||
|
aliasStrings, _ := validProjectsFunc(cmd, args, toComplete)
|
||
|
return append(projectStrings, aliasStrings...), cobra.ShellCompDirectiveDefault
|
||
|
}
|