Skip to content
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

Fix usage writing when using custom version flag #224

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

hhromic
Copy link
Contributor

@hhromic hhromic commented Jul 15, 2023

Hi @alexflint , this is a small follow-up to PR #223 :)

I realized that I forgot to update the write usage function, and it was still printing the output of Version() even if a custom --version flag spec is present in the arguments. This is now also fixed and I added more unit tests for help/usage writing.

I also took the opportunity to improve a bit the way version flag specs are scanned for both usage and help writing.

I belive that this PR now fully addresses issue #171 because, when using a custom --version flag, the builtin version string (if any) is not printed anymore in usage and errors.

Fixes #171

@codecov-commenter
Copy link

codecov-commenter commented Jul 15, 2023

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (bf629a1) 99.17% compared to head (851ff4c) 99.73%.

❗ Your organization needs to install the Codecov GitHub app to enable full functionality.

Additional details and impacted files
@@            Coverage Diff             @@
##           master     #224      +/-   ##
==========================================
+ Coverage   99.17%   99.73%   +0.55%     
==========================================
  Files           5        5              
  Lines         731      744      +13     
==========================================
+ Hits          725      742      +17     
+ Misses          3        1       -2     
+ Partials        3        1       -2     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@hhromic hhromic changed the title Better version v2 Follow up to improving the handling of version flag Jul 15, 2023
@hhromic hhromic changed the title Follow up to improving the handling of version flag Fix usage writing when using custom version flag Jul 15, 2023
@hhromic
Copy link
Contributor Author

hhromic commented Jan 18, 2024

Rebased on top of the latest master branch.
@alexflint any chance of taking a look a this PR? :)
Thanks!

@alexflint
Copy link
Owner

@hhromic This looks good but I need to look closer because there are quite a few changes (even ignoring the tests -- thanks for adding those)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Overriding --version
3 participants