-
Notifications
You must be signed in to change notification settings - Fork 245
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Exit with proper exit code. #263
Conversation
Thank you for your contribution. This would need to be refactored to only fail on an actual error condition, e.g. the I'd like to do what git does, e.g. the base command with no_args displaying help is not an error condition, but an expected behavior.
Thus, in order to support this, we would need to actually detect and display error message on unknown arguments (rather than just ignore them, which we do now), and use an error code only in that case.
(This may be easier to do as part of #259 when we rely on Methadone for option parsing). |
Hmm.. what version of git do you run? On
|
@williamboman it looks like the exit code is intentionally changed by Been thinking through this one a lot, detailed response incoming after I type it all up. |
Having a single exit code indicating successful/non-erroneous executions is a bit troublesome. I generally like to think that when a shell command actually executes an action, or is able to unambiguously determine what the user wants, it should exit with |
So been looking into this one a lot. Some thoughts & notes:
But -- even if considering On that note, I am actually going to consider submitting a patch request to git itself changing the "no op" exit error code from Now, back to lolcommits. I've been reviewing the CLI code and the current UX behavior for Therefore, two new tasks for lolcommits:
Both issues are probably going to be easier to tackle as the CLI handler continues to get refactored and cleaned up (the second in particular will end up likely creating duplication until #259 is tackled.) Thanks for your patience on my turning what started as a simple issue into a complex one. 😎 |
Makes things more interesting, the more you know :)! You definitely seem to have given it a lot of thought and done quite extensive research, so I'm gonna start off with just closing this as there, evidently, are different & better implementations identified for the future.
The only command I tested was actually just
Will be interesting to see the discussion if you do. I personally couldn't find a credible consensus anywhere on how to determine and when to use non-0 exit codes in cases like this. |
I suppose this is somewhat subjective, however, I expected e.g.
to exit with a non-
0
code, sorta like howgit
does.