improve package gcmd

This commit is contained in:
John Guo
2021-12-04 00:26:45 +08:00
parent 0da5535bda
commit 71399d1f65

View File

@ -26,6 +26,7 @@ import (
const (
tagNameDc = `dc`
tagNameAd = `ad`
tagNameEg = `eg`
tagNameArgs = `args`
tagNameRoot = `root`
)
@ -120,6 +121,9 @@ func newCommandFromObjectMeta(object interface{}) (command Command, err error) {
if command.Description == "" {
command.Description = metaData[tagNameDc]
}
if command.Examples == "" {
command.Examples = metaData[tagNameEg]
}
if command.Additional == "" {
command.Additional = metaData[tagNameAd]
}