refactor: move CLI to clap derive (no behavior change) + prep modular CLI
#52
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Why?
What?
src/cli.rsdefines the full CLI usingclap’s derive API.account/from/tonow validated as 32 hex chars (parse_account_id).quantityvalidated as >= 1.Note
I considered introducing an
AccountIdnewtype (withFromStr) now, but left it for a follow-up to keep this PR focused and small.Main impact?
--helpis cleaner. Old flags still work via visible aliases.cli.rs). The dispatcher inlib.rskeeps working because argument IDs are unchanged.What next?
Introduce
AccountId(inbourso_api) to solve primitive obsession properly. ImplementFromStrand use it in CLI + API.Split handlers into modules (small, testable functions):
Example target: