Skip to content

Comments

Redesign CLI parsing subsystem to reduce boilerplate and improve readability#423

Merged
ryanfowler merged 1 commit intomainfrom
refactor/cli-parsing-redesign
Feb 11, 2026
Merged

Redesign CLI parsing subsystem to reduce boilerplate and improve readability#423
ryanfowler merged 1 commit intomainfrom
refactor/cli-parsing-redesign

Conversation

@ryanfowler
Copy link
Owner

  • Add core.CutTrimmed to deduplicate cut() between cli and config packages
  • Consolidate error types (MissingEnvVarError, fileIsDirError) into errors.go
  • Extract parseURL to deduplicate URL normalization between ArgFn and applyFromCurl
  • Replace dataSet/jsonSet/xmlSet booleans with bodySource enum
  • Create flags.go with declarative helpers (boolFlag, ptrBoolFlag, stringFlag, cfgFlag)
  • Extract 15 flag handler methods and buildAWSConfig to deduplicate AWS config construction
  • Rewrite CLI() using helpers, reducing it from ~1,000 to ~230 lines
  • Unify validation with declarative SchemeExclusiveFlags and FromCurlExclusiveFlags

…ability

- Add core.CutTrimmed to deduplicate cut() between cli and config packages
- Consolidate error types (MissingEnvVarError, fileIsDirError) into errors.go
- Extract parseURL to deduplicate URL normalization between ArgFn and applyFromCurl
- Replace dataSet/jsonSet/xmlSet booleans with bodySource enum
- Create flags.go with declarative helpers (boolFlag, ptrBoolFlag, stringFlag, cfgFlag)
- Extract 15 flag handler methods and buildAWSConfig to deduplicate AWS config construction
- Rewrite CLI() using helpers, reducing it from ~1,000 to ~230 lines
- Unify validation with declarative SchemeExclusiveFlags and FromCurlExclusiveFlags
@ryanfowler ryanfowler force-pushed the refactor/cli-parsing-redesign branch from d35ef86 to e8e0ac6 Compare February 11, 2026 08:48
@ryanfowler ryanfowler merged commit affd32f into main Feb 11, 2026
10 checks passed
@ryanfowler ryanfowler deleted the refactor/cli-parsing-redesign branch February 11, 2026 15:48
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