Skip to content

refactor(Cli): Split parseCommandLinePartial into named helpers#309

Open
dimension-zero wants to merge 1 commit into
fsprojects:masterfrom
dimension-zero:pr/21-cli-parsecommandlinepartial-refactor
Open

refactor(Cli): Split parseCommandLinePartial into named helpers#309
dimension-zero wants to merge 1 commit into
fsprojects:masterfrom
dimension-zero:pr/21-cli-parsecommandlinepartial-refactor

Conversation

@dimension-zero
Copy link
Copy Markdown
Contributor

refactor(Cli): Split parseCommandLinePartial into named helpers

Behaviour-preserving split. The outer match in parseCommandLinePartial
now delegates to three named functions:

  • handleMainCommandOrUnrecognized — the UnrecognizedOrArgument arm,
    covering main-command primitive/list parsing and the
    unrecognized-token fallback.
  • handleGroupedParams — the grouped-switches arm (e.g. '-abc' for
    '-a -b -c').
  • handleCliParam — the dispatch on caseInfo.ParameterInfo for fully
    parsed CliParam tokens.

All four functions are mutually 'and'-bound with parseCommandLineInner
so the SubCommand path still recurses cleanly. No call sites change;
all 112 tests pass byte-identical.


Behaviour-preserving split. The outer match in parseCommandLinePartial
now delegates to three named functions:
* handleMainCommandOrUnrecognized — the UnrecognizedOrArgument arm,
  covering main-command primitive/list parsing and the
  unrecognized-token fallback.
* handleGroupedParams — the grouped-switches arm (e.g. '-abc' for
  '-a -b -c').
* handleCliParam — the dispatch on caseInfo.ParameterInfo for fully
  parsed CliParam tokens.

All four functions are mutually 'and'-bound with parseCommandLineInner
so the SubCommand path still recurses cleanly. No call sites change;
all 112 tests pass byte-identical.
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