mirror of
https://gitee.com/johng/gf.git
synced 2024-11-30 03:07:45 +08:00
improve package gcmd for help content printing
This commit is contained in:
parent
80daed6bdf
commit
7d84ab761b
@ -42,11 +42,14 @@ func (c *Command) Print() {
|
||||
name = p.parent.Name + " " + name
|
||||
p = p.parent
|
||||
}
|
||||
if c.hasArgumentFromIndex() {
|
||||
buffer.WriteString(fmt.Sprintf(`%s ARGUMENT [OPTION]`, name))
|
||||
} else {
|
||||
buffer.WriteString(fmt.Sprintf(`%s [OPTION]`, name))
|
||||
buffer.WriteString(name)
|
||||
if len(c.commands) > 0 {
|
||||
buffer.WriteString(` COMMAND`)
|
||||
}
|
||||
if c.hasArgumentFromIndex() {
|
||||
buffer.WriteString(` ARGUMENT`)
|
||||
}
|
||||
buffer.WriteString(` [OPTION]`)
|
||||
}
|
||||
buffer.WriteString("\n\n")
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user