diff --git a/asusctl/src/aura_cli.rs b/asusctl/src/aura_cli.rs index 08dbfba8..95b2cfce 100644 --- a/asusctl/src/aura_cli.rs +++ b/asusctl/src/aura_cli.rs @@ -8,7 +8,7 @@ use rog_aura::{AuraEffect, AuraModeNum, AuraZone, Colour, Direction, Speed}; #[derive(FromArgs, Debug, Clone)] #[argh( subcommand, - name = "aura-power-old", + name = "power-tuf", description = "aura power (old ROGs and TUF laptops)" )] pub struct LedPowerCommand1 { @@ -38,7 +38,7 @@ pub struct LedPowerCommand1 { } #[derive(FromArgs, Debug, Clone)] -#[argh(subcommand, name = "aura-power", description = "aura power")] +#[argh(subcommand, name = "power", description = "aura power")] pub struct LedPowerCommand2 { #[argh(subcommand)] pub command: Option, diff --git a/asusctl/src/cli_opts.rs b/asusctl/src/cli_opts.rs index 55687562..32cb746e 100644 --- a/asusctl/src/cli_opts.rs +++ b/asusctl/src/cli_opts.rs @@ -18,9 +18,7 @@ pub struct CliStart { #[derive(FromArgs, Debug)] #[argh(subcommand)] pub enum CliCommand { - Aura(LedModeCommand), - AuraPowerOld(LedPowerCommand1), - AuraPower(LedPowerCommand2), + Aura(AuraCommand), Brightness(BrightnessCommand), Profile(ProfileCommand), FanCurve(FanCurveCommand), @@ -99,7 +97,7 @@ pub struct ProfileSetCommand { } #[derive(FromArgs, Debug, Default)] -#[argh(subcommand, name = "aura", description = "led mode commands")] +#[argh(subcommand, name = "effect", description = "led mode commands")] pub struct LedModeCommand { #[argh(switch, description = "switch to next aura mode")] pub next_mode: bool, @@ -111,6 +109,21 @@ pub struct LedModeCommand { pub command: Option, } +#[derive(FromArgs, Debug)] +#[argh(subcommand, name = "aura", description = "aura device commands")] +pub struct AuraCommand { + #[argh(subcommand)] + pub command: AuraSubCommand, +} + +#[derive(FromArgs, Debug)] +#[argh(subcommand)] +pub enum AuraSubCommand { + Power(LedPowerCommand2), + PowerTuf(LedPowerCommand1), + Effect(LedModeCommand), +} + #[derive(FromArgs, Debug, Default)] #[argh( subcommand, diff --git a/asusctl/src/main.rs b/asusctl/src/main.rs index 972472ba..c333d09a 100644 --- a/asusctl/src/main.rs +++ b/asusctl/src/main.rs @@ -186,9 +186,11 @@ fn do_parsed( conn: Connection, ) -> Result<(), Box> { match &parsed.command { - CliCommand::Aura(mode) => handle_led_mode(mode)?, - CliCommand::AuraPowerOld(pow) => handle_led_power1(pow)?, - CliCommand::AuraPower(pow) => handle_led_power2(pow)?, + CliCommand::Aura(a) => match &a.command { + crate::cli_opts::AuraSubCommand::Effect(mode) => handle_led_mode(mode)?, + crate::cli_opts::AuraSubCommand::PowerTuf(pow) => handle_led_power1(pow)?, + crate::cli_opts::AuraSubCommand::Power(pow) => handle_led_power2(pow)?, + }, CliCommand::Brightness(cmd) => handle_brightness(cmd)?, CliCommand::Profile(cmd) => handle_throttle_profile(&conn, supported_properties, cmd)?, CliCommand::FanCurve(cmd) => handle_fan_curve(&conn, cmd)?, @@ -720,7 +722,7 @@ fn handle_led_power1(power: &LedPowerCommand1) -> Result<(), Box Result<(), Box