Skip to content

fix: add strict flag validation and version-requested semantics#55

Merged
ardan-bkennedy merged 1 commit intoardanlabs:masterfrom
codemedic:handle-unknown-and-version-flags
Dec 9, 2025
Merged

fix: add strict flag validation and version-requested semantics#55
ardan-bkennedy merged 1 commit intoardanlabs:masterfrom
codemedic:handle-unknown-and-version-flags

Conversation

@codemedic
Copy link
Contributor

Fixes #54

@ardan-bkennedy
Copy link
Collaborator

I saw this today but I haven't been able to get to it. I will try again early next week. Thanks for taking the time to think about this.

@ardan-bkennedy
Copy link
Collaborator

Would you be ok getting on a video call to review this. Changes like this can break things and I want to walk through the code.

The initial idea was to return any flags we didn't process for config so people could use this one package for everything flag related. You wanting to fail if something is not matching is a big change in behavior. The only behavior needs to be maintained.

I rather review this with you one-on-one so we can make sure nothing breaks.

@codemedic
Copy link
Contributor Author

Hi @ardan-bkennedy,

Apologies for the delay; I’ve been away on holiday for the past two weeks.

I would love to hop on a call to align on this. I am generally available after 9:00 PM UTC.

Regarding the technical details, I’ve re-evaluated the impact on backward compatibility. Here is the breakdown:

  • The Breaking Change: The primary shift is the introduction of ErrVersionWanted. Previously, this logic was bundled under ErrHelpWanted. Splitting these out changes the default behavior for users relying on the old error grouping.

  • Backward Compatible Elements: strictFlags remains off by default, ensuring no unexpected strictness for existing users.

    • Optional parsers maintain their existing behavior.

Essentially, the compatibility risk is localized to the specific error type handling. Let me know if that timeframe works for a quick sync!

@ardan-bkennedy ardan-bkennedy merged commit 36d8e95 into ardanlabs:master Dec 9, 2025
4 of 5 checks passed
@codemedic codemedic deleted the handle-unknown-and-version-flags branch December 10, 2025 09:33
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.

Unknown / undefined flags do not result in an error

2 participants