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
|
name = p.parent.Name + " " + name
|
||||||
p = p.parent
|
p = p.parent
|
||||||
}
|
}
|
||||||
if c.hasArgumentFromIndex() {
|
buffer.WriteString(name)
|
||||||
buffer.WriteString(fmt.Sprintf(`%s ARGUMENT [OPTION]`, name))
|
if len(c.commands) > 0 {
|
||||||
} else {
|
buffer.WriteString(` COMMAND`)
|
||||||
buffer.WriteString(fmt.Sprintf(`%s [OPTION]`, name))
|
|
||||||
}
|
}
|
||||||
|
if c.hasArgumentFromIndex() {
|
||||||
|
buffer.WriteString(` ARGUMENT`)
|
||||||
|
}
|
||||||
|
buffer.WriteString(` [OPTION]`)
|
||||||
}
|
}
|
||||||
buffer.WriteString("\n\n")
|
buffer.WriteString("\n\n")
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user