openlogi-cli 0.0.1

Implementation library for the OpenLogi CLI (the `openlogi` binary).
Documentation
use anyhow::Result;
use clap::Subcommand;

pub mod assets;
pub mod diag;
pub mod list;

#[derive(Debug, Subcommand)]
pub enum Command {
    /// List connected Logitech HID++ devices.
    List(list::ListArgs),
    /// Manage assets fetched from assets.openlogi.org.
    #[command(subcommand)]
    Assets(assets::AssetsCmd),
    /// Real-device round-trip smoke tests against the HID++ write path.
    #[command(subcommand)]
    Diag(diag::DiagCmd),
}

impl Command {
    pub async fn run(self) -> Result<()> {
        match self {
            Self::List(args) => list::run(args).await,
            // `assets sync` is blocking HTTP — no need for the async runtime.
            Self::Assets(cmd) => cmd.run(),
            Self::Diag(cmd) => cmd.run().await,
        }
    }
}