Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor(cli): merge argument parsing and command execution #1568

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

SuperFluffy
Copy link
Member

@SuperFluffy SuperFluffy commented Sep 26, 2024

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

@SuperFluffy SuperFluffy force-pushed the ENG-834/merge-cli-and-command-structs branch from f90d3e3 to b640028 Compare September 26, 2024 12:38
@SuperFluffy SuperFluffy marked this pull request as ready for review September 26, 2024 12:53
@SuperFluffy SuperFluffy requested a review from a team as a code owner September 26, 2024 12:53
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.

Don't distinguish between command types and their handlers
2 participants