p.Task("hello", func(c *Context) {
// "(none)" is the default value
msg := c.Args.MayString("(none)", "message", "msg", "m")
var name string
if len(c.Args.Leftover() == 1) {
name = c.Args.Leftover()[0]
}
fmt.Println(msg, name)
})
line
if len(c.Args.Leftover() == 1) {
must be
if len(c.Args.Leftover()) == 1 {
Looks like you have a typo in this block:
line
if len(c.Args.Leftover() == 1) {
must beif len(c.Args.Leftover()) == 1 {