node/profile list syntax doesn't support comma-separated values

Signed-off-by: jason yang <jasonyangshadow@gmail.com>
This commit is contained in:
jason yang
2023-04-06 04:35:46 +00:00
parent ab52e389f6
commit 59390b4dda
4 changed files with 119 additions and 4 deletions

View File

@@ -11,6 +11,9 @@ import (
func CobraRunE(vars *variables) func(cmd *cobra.Command, args []string) (err error) {
return func(cmd *cobra.Command, args []string) (err error) {
if len(args) > 0 && strings.Contains(args[0], ",") {
args = strings.FieldsFunc(args[0], func(r rune) bool { return r == ',' })
}
req := wwapiv1.GetNodeList{
Nodes: args,
Type: wwapiv1.GetNodeList_Simple,