Skip to content

Type CLI worker flags so clap validates values at parse time#53

Merged
asiniscalchi merged 1 commit into
mainfrom
refactor/cli-typed-worker-flags
May 3, 2026
Merged

Type CLI worker flags so clap validates values at parse time#53
asiniscalchi merged 1 commit into
mainfrom
refactor/cli-typed-worker-flags

Conversation

@asiniscalchi

Copy link
Copy Markdown
Owner

Replace Option worker fields in cli.rs with Option / Option / Option, using value_parser ranges to enforce positive integers. clap now rejects non-bool inputs ("yes", "1") and zero/non-numeric counts before serve_config() runs, surfacing the flag/env-var name in the error.

ReconciliationWorkerConfig::from_values and
DailyReviewDeliveryWorkerConfig::from_values become infallible defaulting helpers. WorkerEnvLabels and the bespoke validation error enums are removed since clap owns the validation surface.

Replace Option<String> worker fields in cli.rs with Option<bool> /
Option<u32> / Option<u64>, using value_parser ranges to enforce
positive integers. clap now rejects non-bool inputs ("yes", "1") and
zero/non-numeric counts before serve_config() runs, surfacing the
flag/env-var name in the error.

ReconciliationWorkerConfig::from_values and
DailyReviewDeliveryWorkerConfig::from_values become infallible
defaulting helpers. WorkerEnvLabels and the bespoke validation error
enums are removed since clap owns the validation surface.
@asiniscalchi asiniscalchi merged commit 782c460 into main May 3, 2026
2 checks passed
@asiniscalchi asiniscalchi deleted the refactor/cli-typed-worker-flags branch May 3, 2026 03:54
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