erg-lang / erg

A statically typed language compatible with Python
http://erg-lang.org
Apache License 2.0
2.69k stars 55 forks source link

Avoid panicking with invalid option args #288

Closed GreasySlug closed 1 year ago

GreasySlug commented 1 year ago

In Erg, it caused panic when there was an invalid argument. However, in other languages, instead of panicking, indicate that it is an invalid argument and have them refer to help. Added a message to that effect.

Changes proposed in this PR:

@mtshiba

mtshiba commented 1 year ago

Good. One thing I would add is that in Python, the return code seems to be 2 when an invalid option is passed, Erg should do that as well.

mtshiba commented 1 year ago

Thanks!