44 lines
955 B
Rust
44 lines
955 B
Rust
|
|
use clap::{Parser, Subcommand};
|
||
|
|
use kordophone::APIInterface;
|
||
|
|
|
||
|
|
#[derive(Parser)]
|
||
|
|
#[command(name = "kpcli")]
|
||
|
|
#[command(about = "CLI tool for the Kordophone daemon")]
|
||
|
|
struct Cli {
|
||
|
|
#[command(subcommand)]
|
||
|
|
command: Commands,
|
||
|
|
}
|
||
|
|
|
||
|
|
#[derive(Subcommand)]
|
||
|
|
enum Commands {
|
||
|
|
/// Commands for api client operations
|
||
|
|
Client {
|
||
|
|
#[command(subcommand)]
|
||
|
|
command: ClientCommands,
|
||
|
|
},
|
||
|
|
}
|
||
|
|
|
||
|
|
#[derive(Subcommand)]
|
||
|
|
enum ClientCommands {
|
||
|
|
ListConversations,
|
||
|
|
Version,
|
||
|
|
}
|
||
|
|
|
||
|
|
fn main() {
|
||
|
|
let cli = Cli::parse();
|
||
|
|
|
||
|
|
match cli.command {
|
||
|
|
Commands::Client { command } => match command {
|
||
|
|
ClientCommands::ListConversations => {
|
||
|
|
println!("Listing conversations...");
|
||
|
|
// TODO: Implement conversation listing
|
||
|
|
},
|
||
|
|
|
||
|
|
ClientCommands::Version => {
|
||
|
|
println!("Getting version...");
|
||
|
|
// TODO: Implement version getting
|
||
|
|
},
|
||
|
|
},
|
||
|
|
}
|
||
|
|
}
|