2.1 KiB
2.1 KiB
id, name, status, depends_on, scope, risk, impact, level
| id | name | status | depends_on | scope | risk | impact | level | ||
|---|---|---|---|---|---|---|---|---|---|
| config/cli-parsing | Implement CLI argument parsing with clap and config file loading | completed |
|
narrow | low | component | implementation |
Description
Implement the CLI entry point using clap with derive macros. The CLI reads the config file, deserializes both static and dynamic portions, validates, and returns the parsed config.
CLI Interface
reverse-proxy [OPTIONS]
Options:
--config <PATH> Path to config file [default: /etc/reverse-proxy/config.toml]
--validate Validate config and exit
--allow-wildcard-bind Permit 0.0.0.0 as a bind address (for container deployments)
--help Show help
--version Show version
The --allow-wildcard-bind flag is OR'd with the config allow_wildcard_bind field — if either is set, wildcard binding is allowed.
Behavior
--validate: Load and validate the config, print success or errors, exit 0 or 1- Normal run: Load, validate, return config for the startup sequence
- Config file not found: exit with error
- Config validation fails: exit with code 1 and log all errors
Acceptance Criteria
clapwith derive macros for CLI parsing--configflag with default/etc/reverse-proxy/config.toml--validateflag: loads, validates, reports, exits--allow-wildcard-bindflag: OR'd with config value--versionprints version fromCargo.toml- Config file loading and TOML deserialization
- Validation runs on every load (startup and
--validate) - Error messages are clear and actionable
- Unit tests for CLI argument parsing
- Integration test:
--validatewith valid config exits 0 - Integration test:
--validatewith invalid config exits 1 and reports errors
References
- docs/architecture/operations.md — CLI interface
- docs/architecture/config.md — config loading, validation
- docs/architecture/decisions/016-explicit-bind-address.md —
allow_wildcard_bind
Notes
To be filled by implementation agent
Summary
To be filled on completion