Exit after printing out version information#743
Merged
Conversation
Collaborator
|
I agree |
Collaborator
|
@webwarrior-ws @Numpsy do you have any remarks? |
There was a problem hiding this comment.
Pull Request Overview
Ensures that when the --version flag is used, the program prints version info and takes a dedicated code path rather than immediately invoking the subcommand logic.
- Added an
elsebranch so thathandleErroris only defined when not printing version - Cleaned up a stray whitespace line after version printing
Collaborator
|
Why not do what Copilot proposes instead of doing a huge diff that just shifts code to the right? |
Collaborator
|
@Numpsy, what do you think about the suggestion? |
Rather than then trying to call GetSubCommand() and breaking when there isn't one.
Contributor
Author
I'm not personally partucularly fond of early process exit, but have changed it to that if that's what is preferred |
xperiandri
approved these changes
Jul 16, 2025
Collaborator
knocte
requested changes
Jul 16, 2025
xperiandri
approved these changes
Jul 16, 2025
xperiandri
added a commit
that referenced
this pull request
Jul 18, 2025
## [0.26.0] - 2025-07-18 - Fix MSBuild integration sample in docs #750 [@xperiandri] - Exit after printing out version information #743 [@Numpsy] - Fix .NET 8 support #748 [@xperiandri] - Update docs to note that linting supports `slnx` and `slnf` files #744 [@Numpsy]
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Rather than then trying to call GetSubCommand() and breaking when there isn't one.
refs #741
Just a thought at a simple change to exit after printing the version information, rather than making a call to GetSubCommand() that can fail if there no other commands specified.
If it needs to support printing the version and then doing a lint, maybe it needs to use TryGetSubCommand() instead.