refactor(cli): merge argument parsing and command execution #1568
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.
Summary
Refactors the CLI to give it a cleaner structure.
Background
The CLI was split into a
cli
module that was concerned with parsing arguments, and acommands
which consumed the argument data structures.The patch clears this up by implementing inherent
<Args>::run
methods on all leaf argument types, so that the implementation follows the same structure for all its effects.Note that this match does restructure the public facing command line (except for a few lines of documentation). It merely restructures the implementation.
Changes
clap::Args
to have an inherent methodrun
.Testing
These will be tested in follow PRs. Smoke tests using a subset of the astria CLI commands should still work.
Related Issues
Closes #1546