improve package gcmd/gtag

This commit is contained in:
John Guo
2021-12-10 23:58:10 +08:00
parent 34e7913268
commit f0c25d8476
2 changed files with 10 additions and 0 deletions

View File

@ -57,6 +57,9 @@ func NewFromObject(object interface{}) (rootCmd *Command, err error) {
rootCommandName = gmeta.Get(object, tagNameRoot).String()
subCommands []*Command
)
if rootCommandName == "" {
rootCommandName = rootCmd.Name
}
for i := 0; i < originValueAndKind.InputValue.NumMethod(); i++ {
var (
method = originValueAndKind.InputValue.Method(i)