Skip to content

Add TryGetOptionArgument #5977

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

Draft
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

SimonCropp
Copy link
Contributor

So usages of TryGetOptionArgumentList are problematic

  • some usages use the first arg and ignore the rest
  • some usages check if there is only one and dont use the first if there is more than one
  • some usages assume there is 1 and will throw if that is not correct

so this PR adds TryGetOptionArgument. which will formalize the usages. it will:

  • return false if there is no arg
  • return false if there is no items in the arg
  • throw if there is more than 1

@SimonCropp SimonCropp marked this pull request as draft July 10, 2025 12:20
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.

1 participant