mod account;
mod assets;
mod audio;
mod ble;
mod busy;
mod display;
mod input;
mod settings;
mod smart_home;
mod storage;
mod system;
mod time;
mod updater;
mod wifi;
use clap::Subcommand;
use crate::cli::Context;
use crate::error::Result;
#[derive(Debug, Subcommand)]
pub enum Command {
Account {
#[command(subcommand)]
command: account::AccountCommand,
},
Assets {
#[command(subcommand)]
command: assets::AssetsCommand,
},
Audio {
#[command(subcommand)]
command: audio::AudioCommand,
},
Ble {
#[command(subcommand)]
command: ble::BleCommand,
},
Busy {
#[command(subcommand)]
command: busy::BusyCommand,
},
Display {
#[command(subcommand)]
command: display::DisplayCommand,
},
Input {
#[command(subcommand)]
command: input::InputCommand,
},
Settings {
#[command(subcommand)]
command: settings::SettingsCommand,
},
#[command(name = "smart-home")]
SmartHome {
#[command(subcommand)]
command: smart_home::SmartHomeCommand,
},
Storage {
#[command(subcommand)]
command: storage::StorageCommand,
},
System {
#[command(subcommand)]
command: system::SystemCommand,
},
Time {
#[command(subcommand)]
command: time::TimeCommand,
},
Updater {
#[command(subcommand)]
command: updater::UpdaterCommand,
},
Wifi {
#[command(subcommand)]
command: wifi::WifiCommand,
},
}
impl Command {
pub async fn run(self, context: &Context) -> Result<()> {
match self {
Command::Account { command } => command.run(context).await,
Command::Assets { command } => command.run(context).await,
Command::Audio { command } => command.run(context).await,
Command::Ble { command } => command.run(context).await,
Command::Busy { command } => command.run(context).await,
Command::Display { command } => command.run(context).await,
Command::Input { command } => command.run(context).await,
Command::Settings { command } => command.run(context).await,
Command::SmartHome { command } => command.run(context).await,
Command::Storage { command } => command.run(context).await,
Command::System { command } => command.run(context).await,
Command::Time { command } => command.run(context).await,
Command::Updater { command } => command.run(context).await,
Command::Wifi { command } => command.run(context).await,
}
}
}