pumas 0.5.0

A power usage monitor for Apple Silicon.
Documentation
//! Main runner

use clap::{CommandFactory, Parser};
use clap_complete::generate;

use pumas::{
    Result,
    config::{Command, Config},
    monitor,
};

fn main() -> Result<()> {
    let config = Config::parse();
    match config.command {
        Command::Run { args } => {
            monitor::run(args)?;
        }

        Command::GenerateCompletion { shell } => {
            let mut app = Config::command();
            let name = app.get_name().to_string();
            generate(shell, &mut app, name, &mut std::io::stdout());
        }
    }

    Ok(())
}