mkideal / cli

CLI - A package for building command line app with go
MIT License
730 stars 43 forks source link

NumArg: AtLeast 1 #28

Closed suntong closed 7 years ago

suntong commented 7 years ago

Hi 仕晋,

Found a very strange error, please take a look at https://gist.github.com/suntong/fdd74049660315e54fa72ecb5fd2f04e

If I run it with go run /tmp/dump.go, the help output is OK.

However, when I run it with go run /tmp/dump.go -i or even go run /tmp/dump.go -i aaa, it still prints the help output instead of invoking the actual command.

Why is that? Thx.

suntong commented 7 years ago

I tried to change "NumArg: cli.AtLeast(1)" to "NumOption: cli.AtLeast(1)", but the behavior is still the same.

suntong commented 7 years ago

yep, should be NumOption: cli.AtLeast(1). Closing the invalid report.