Skip to content

refactor: decompose Parse into focused helpers and fix edge cases#8

Merged
mfridman merged 5 commits intomainfrom
mf/parse-improvements
Feb 16, 2026
Merged

refactor: decompose Parse into focused helpers and fix edge cases#8
mfridman merged 5 commits intomainfrom
mf/parse-improvements

Conversation

@mfridman
Copy link
Collaborator

@mfridman mfridman commented Feb 16, 2026

This PR breaks the monolithic Parse function into smaller, focused helpers (splitAtDelimiter, resolveCommandPath, combineFlags, checkRequiredFlags, collectArgs) for better readability and testability.

It also fixes several edge cases:

  • ancestor flags are now checked across the full command chain during resolution (not just the current command)
  • required flag detection uses Visit instead of comparing against default values (so explicitly passing the default satisfies the requirement)
  • location() properly trims absolute file paths

@mfridman mfridman merged commit 85eb0e7 into main Feb 16, 2026
3 checks passed
@mfridman mfridman deleted the mf/parse-improvements branch February 16, 2026 17:29
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