Private
Public Access
1
0

kpcli: adds 'db' subcommand for interacting with the database

This commit is contained in:
2025-01-08 13:32:55 -08:00
parent 89f8d21ebb
commit 793faab721
10 changed files with 197 additions and 29 deletions

View File

@@ -1,5 +1,8 @@
mod client;
mod db;
mod printers;
mod client;
use anyhow::Result;
use clap::{Parser, Subcommand};
/// A command line interface for the Kordophone library and daemon
@@ -17,11 +20,18 @@ enum Commands {
#[command(subcommand)]
command: client::Commands,
},
/// Commands for the cache database
Db {
#[command(subcommand)]
command: db::Commands,
}
}
async fn run_command(command: Commands) -> Result<(), Box<dyn std::error::Error>> {
async fn run_command(command: Commands) -> Result<()> {
match command {
Commands::Client { command } => client::Commands::run(command).await,
Commands::Db { command } => db::Commands::run(command).await,
}
}