diff --git a/src/main.rs b/src/main.rs index 1113874..9c1725a 100644 --- a/src/main.rs +++ b/src/main.rs @@ -61,14 +61,6 @@ pub enum FanMode { Automatic, } -#[derive(Options)] -pub enum Command { - #[options(help = "GPU card fan control")] - Fan(fan::FanCommand), - #[options(help = "Overclock GPU card")] - Voltage(voltage::VoltageCommand), -} - #[derive(Options)] pub struct Opts { #[options(help = "Help message")] @@ -76,7 +68,7 @@ pub struct Opts { #[options(help = "Print version")] version: bool, #[options(command)] - command: Option, + command: Option, } fn main() -> std::io::Result<()> { @@ -100,15 +92,15 @@ fn main() -> std::io::Result<()> { match opts.command { None => fan::service::run(config), - Some(Command::Fan(fan::FanCommand::Monitor(monitor))) => fan::monitor::run(monitor, config), - Some(Command::Fan(fan::FanCommand::Service(_))) => fan::service::run(config), - Some(Command::Fan(fan::FanCommand::SetAutomatic(switcher))) => { + Some(fan::FanCommand::Monitor(monitor)) => fan::monitor::run(monitor, config), + Some(fan::FanCommand::Service(_)) => fan::service::run(config), + Some(fan::FanCommand::SetAutomatic(switcher)) => { fan::change_mode::run(switcher, FanMode::Automatic, config) } - Some(Command::Fan(fan::FanCommand::SetManual(switcher))) => { + Some(fan::FanCommand::SetManual(switcher)) => { fan::change_mode::run(switcher, FanMode::Manual, config) } - Some(Command::Fan(fan::FanCommand::Available(_))) => { + Some(fan::FanCommand::Available(_)) => { println!("Available cards"); utils::controllers(&config, false)? .into_iter() @@ -121,8 +113,5 @@ fn main() -> std::io::Result<()> { }); Ok(()) } - Some(Command::Voltage(voltage::VoltageCommand::Placeholder(_))) => { - unimplemented!() - } } }