simplified node list command

This commit is contained in:
Christian Goll
2022-07-18 19:27:57 +02:00
parent 1dd519a7e6
commit e23f794166
8 changed files with 442 additions and 866 deletions

View File

@@ -580,3 +580,20 @@ func (baseCmd *CobraCommand) CreateFlags(theStruct interface{}, excludeList []st
}
return optionsMap
}
/*
Helper function which gets the lopt of a given interface
*/
func GetLoptOf(myStruct interface{}, name string) string {
retStr := ""
if reflect.TypeOf(myStruct).Kind() != reflect.Struct {
return retStr
}
myType := reflect.TypeOf(myStruct)
field, ok := myType.FieldByName(name)
if ok {
retStr = field.Tag.Get("lopt")
}
return retStr
}