You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Astria-cli distinguishes between the Cli container, which provides the entry point to the command line utility, and their various handlers that take the parsed CLI options as an argument.
This separation is confusing and arguably not idiomatic.
astria-cli should be refactored such that each subcommand derives the clap::Args, but also provides an entrypoint fn run(self), i.e.:
#[derive(Args,Debug)]structTheSubcommand{// options, flags, etc}implTheSubcommand{fnrun(self) -> Result<T,E>{// use the parsed arguments}}
┆Issue Number: ENG-834
The text was updated successfully, but these errors were encountered:
## 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 a `commands` 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
- Refactors each type deriving `clap::Args` to have an inherent method
`run`.
- Flattens the crate structure to not be unnecessarily nested.
## 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
Astria-cli distinguishes between the
Cli
container, which provides the entry point to the command line utility, and their various handlers that take the parsed CLI options as an argument.This separation is confusing and arguably not idiomatic.
astria-cli should be refactored such that each subcommand derives the
clap::Args
, but also provides an entrypointfn run(self)
, i.e.:┆Issue Number: ENG-834
The text was updated successfully, but these errors were encountered: