docopt / docopt.go

A command-line arguments parser that will make you smile.
http://docopt.org/
MIT License
1.43k stars 108 forks source link

[enhancement] add an error message when launching without mandatory argument #61

Open Sylvain303 opened 6 years ago

Sylvain303 commented 6 years ago

reported in docopts (shell wrapper) https://github.com/docopt/docopts/issues/17

I made a go example to reproduce the behavior:

https://github.com/Sylvain303/docopts/blob/debug-issues/issues/17-Empty-error-without-mandatory-argument/atest.go

$ go run atest.go
my error: 
Usage: atest.sh <arg>
       atest.sh ( -h | --help )
       atest.sh ( -V | --version )
exit status 1

Would it be possible to have help full error in err when receiving it in error Handler:

https://github.com/Sylvain303/docopts/blob/debug-issues/issues/17-Empty-error-without-mandatory-argument/atest.go#L41