pub trait CliAdapter {
// Required methods
fn name(&self) -> &'static str;
fn dependencies(&self) -> Vec<Dependency>;
fn generate_cli(&self, info: &CliInfo) -> Vec<CodeFragment>;
fn generate_command(&self, info: &CommandMeta) -> Vec<CodeFragment>;
fn generate_subcommands(&self, info: &CommandMeta) -> Vec<CodeFragment>;
fn generate_dispatch(&self, info: &DispatchInfo) -> Vec<CodeFragment>;
fn imports(&self) -> Vec<ImportSpec>;
fn command_imports(&self, info: &CommandMeta) -> Vec<ImportSpec>;
fn map_arg_type(&self, arg_type: ArgType) -> &'static str;
fn map_optional_type(&self, arg_type: ArgType) -> String;
}Expand description
Trait for CLI framework adapters.
Implement this trait to support a specific CLI framework (clap, boune, etc.).
Required Methods§
Sourcefn dependencies(&self) -> Vec<Dependency>
fn dependencies(&self) -> Vec<Dependency>
Dependencies required by this adapter.
Sourcefn generate_cli(&self, info: &CliInfo) -> Vec<CodeFragment>
fn generate_cli(&self, info: &CliInfo) -> Vec<CodeFragment>
Generate the main CLI entry point structure/definition.
Sourcefn generate_command(&self, info: &CommandMeta) -> Vec<CodeFragment>
fn generate_command(&self, info: &CommandMeta) -> Vec<CodeFragment>
Generate a command definition (args struct, command object, etc.).
Sourcefn generate_subcommands(&self, info: &CommandMeta) -> Vec<CodeFragment>
fn generate_subcommands(&self, info: &CommandMeta) -> Vec<CodeFragment>
Generate subcommand enum/routing for a parent command.
Sourcefn generate_dispatch(&self, info: &DispatchInfo) -> Vec<CodeFragment>
fn generate_dispatch(&self, info: &DispatchInfo) -> Vec<CodeFragment>
Generate dispatch logic for routing to handlers.
Sourcefn imports(&self) -> Vec<ImportSpec>
fn imports(&self) -> Vec<ImportSpec>
Imports needed for CLI code.
Sourcefn command_imports(&self, info: &CommandMeta) -> Vec<ImportSpec>
fn command_imports(&self, info: &CommandMeta) -> Vec<ImportSpec>
Imports needed for a specific command.
Sourcefn map_arg_type(&self, arg_type: ArgType) -> &'static str
fn map_arg_type(&self, arg_type: ArgType) -> &'static str
Map an argument type to the adapter’s type string.
Sourcefn map_optional_type(&self, arg_type: ArgType) -> String
fn map_optional_type(&self, arg_type: ArgType) -> String
Map an optional argument type to the adapter’s type string.