docopt.go icon indicating copy to clipboard operation
docopt.go copied to clipboard

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

Open Sylvain303 opened this issue 7 years ago • 0 comments

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

Sylvain303 avatar Jul 01 '18 07:07 Sylvain303