kpcli: adds 'db' subcommand for interacting with the database
This commit is contained in:
@@ -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,
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user