You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This has a few problems that result in poor error messages:
Using it as ./example.js --test results in: option test need argument ; The argument I used is "--test" not "test", this is what should be reported to the user. This is what GNU "ls" returns: ls: option '--format' requires an argument
Using it as ./example -t results in: option test need argument ; The argument I used is "-t" not "test" (or even "--test"), this is what should be reported to the user. This is what GNU "ls" returns: ls: option requires an argument -- 'I'
Further, there is no capability to fix this without modifying the library because the error() method is passed in an Error object with a string as its error, which does not contain enough information to determine what the error should actually be. This is poor extensibility.
The text was updated successfully, but these errors were encountered:
Currently this library does not have good error messages by default. For example, the example program:
This has a few problems that result in poor error messages:
./example.js --test
results in:option test need argument
; The argument I used is "--test" not "test", this is what should be reported to the user. This is what GNU "ls" returns:ls: option '--format' requires an argument
./example -t
results in:option test need argument
; The argument I used is "-t" not "test" (or even "--test"), this is what should be reported to the user. This is what GNU "ls" returns:ls: option requires an argument -- 'I'
Further, there is no capability to fix this without modifying the library because the
error()
method is passed in an Error object with a string as its error, which does not contain enough information to determine what the error should actually be. This is poor extensibility.The text was updated successfully, but these errors were encountered: