Skip to content

Conversation

@davidjenni
Copy link
Contributor

@davidjenni davidjenni commented Nov 25, 2025

Description

Fix to accept /diag switch in any argument position on cmd line, not just the last argument position.

Related Issues

Resolves #4763

It also addresses the root cause of #4395 but also improves mitigation for #4539

Motivation and Context

Discovered when debugging issue #4539 (diag flag not working). While this is not the root cause for 4539, without the fix in this PR, possible workarounds for 4539 are more brittle.

How Has This Been Tested?

added unit tests to arg parser suite.

Screenshots (if appropriate):

Checklist:

  • My code follows the code style of this project.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have added tests to cover my changes.
  • All new and existing tests passed.

before fix, order of arguments mattered:
- unless /diag is last argument, it is ignored; and the following
  argument is swalloed silently

/diag /l gv.log  -> diagnostic switch is ignored, no log file is created
/l console /diag -> diagnostic output is emitted to console
/l gv.log /diag  -> diagnostic output is emitted to log file
@sonarqubecloud
Copy link

@davidjenni davidjenni marked this pull request as ready for review November 25, 2025 23:45
@arturcic arturcic self-requested a review November 26, 2025 05:32
@arturcic arturcic linked an issue Nov 26, 2025 that may be closed by this pull request
2 tasks
@arturcic arturcic removed a link to an issue Nov 26, 2025
2 tasks
Copy link
Member

@arturcic arturcic left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me

@arturcic arturcic merged commit 24cf318 into GitTools:main Nov 26, 2025
118 checks passed
@mergify
Copy link
Contributor

mergify bot commented Nov 26, 2025

Thank you @davidjenni for your contribution!

@arturcic
Copy link
Member

@davidjenni thanks for taking the time to debug this

@arturcic arturcic added this to the 6.x milestone Nov 26, 2025
@asbjornu
Copy link
Member

Thank you so much for fixing this @davidjenni! Should we perhaps update the documentation for this as well?

@arturcic
Copy link
Member

Thank you so much for fixing this @davidjenni! Should we perhaps update the documentation for this as well?

I think he was suggesting that #4539 (comment)

@asbjornu
Copy link
Member

Thank you so much for fixing this @davidjenni! Should we perhaps update the documentation for this as well?

I think he was suggesting that #4539 (comment)

Indeed!

cmd line help and documentation should be updated

Yes, please! 😊 🙏🏼

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[ISSUE]: /diag is ignored if not last argument

3 participants