From d67eae94d96fc25de8ee65d2bcebadeb9dfc8f5b Mon Sep 17 00:00:00 2001 From: S4NKALP Date: Thu, 12 Mar 2026 00:27:51 +0545 Subject: [PATCH] feat(src): add install-rules command for udev rule installation New Features - Introduced `InstallRules` subcommand to install udev rules for rootless operation. Enhancements - Streamlined `LimitTdp` and `Limit` enum variants by removing unnecessary wrapper structs. - Updated command dispatch in `main` to handle the new `InstallRules` variant. --- src/cli.rs | 10 ++++------ src/main.rs | 1 + 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/src/cli.rs b/src/cli.rs index 2fe81b8..51bd38b 100644 --- a/src/cli.rs +++ b/src/cli.rs @@ -39,6 +39,8 @@ pub enum Commands { }, /// Hardware status Status, + /// Install udev rules for rootless operation + InstallRules, } #[derive(Subcommand, Debug)] @@ -95,9 +97,7 @@ pub enum PowerCommands { /// Set power profile to battery saver BatterySave, /// Set CPU TDP limit (in Watts) - LimitTdp { - watts: u32, - }, + LimitTdp { watts: u32 }, } #[derive(Subcommand, Debug)] @@ -113,9 +113,7 @@ pub enum CoolingCommands { #[derive(Subcommand, Debug)] pub enum BatteryCommands { /// Set the battery charging limit (e.g., 80) - Limit { - percent: u8, - }, + Limit { percent: u8 }, /// Show current battery status Status, } diff --git a/src/main.rs b/src/main.rs index 4265ad7..efb37da 100644 --- a/src/main.rs +++ b/src/main.rs @@ -31,5 +31,6 @@ fn main() { Commands::Power { command } => commands::power::execute(command), Commands::Cooling { command } => commands::cooling::execute(command), Commands::Status => commands::status::execute(), + Commands::InstallRules => commands::install_rules::execute(), } }