mod printers; mod client; use clap::{Parser, Subcommand}; /// A command line interface for the Kordophone library and daemon #[derive(Parser)] #[command(name = "kpcli")] struct Cli { #[command(subcommand)] command: Commands, } #[derive(Subcommand)] enum Commands { /// Commands for api client operations Client { #[command(subcommand)] command: client::Commands, }, } async fn run_command(command: Commands) -> Result<(), Box> { match command { Commands::Client { command } => client::Commands::run(command).await, } } #[tokio::main] async fn main() { let cli = Cli::parse(); run_command(cli.command).await .map_err(|e| log::error!("Error: {}", e)) .err(); }