Skip to content

Don't distinguish between command types and their handlers #1546

@SuperFluffy

Description

@SuperFluffy

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)]
struct TheSubcommand {
    // options, flags, etc
}

impl TheSubcommand {
    fn run(self) -> Result<T, E> {
        // use the parsed arguments
    }
}

┆Issue Number: ENG-834

Metadata

Metadata

Assignees

No one assigned

    Labels

    clipertaining to the cli

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions