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
Currently, if a parsing error occurs, the program exits with code 1; this is hard-coded into the library. However, the program may want to use return code 1 itself and leave another code for the CLI framework. If I understood correctly, to do this, we have to invoke the lower-level parseArgs manually, check if it returned 1, and if so, distinguish it from the program’s 1 somehow (e.g., by checking a global variable). It feels really hacky for such simple task.
A blog post explaining why having different error codes is important.
The text was updated successfully, but these errors were encountered:
Currently, if a parsing error occurs, the program exits with code 1; this is hard-coded into the library. However, the program may want to use return code 1 itself and leave another code for the CLI framework. If I understood correctly, to do this, we have to invoke the lower-level
parseArgs
manually, check if it returned 1, and if so, distinguish it from the program’s 1 somehow (e.g., by checking a global variable). It feels really hacky for such simple task.A blog post explaining why having different error codes is important.
The text was updated successfully, but these errors were encountered: