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.
This commit is contained in:
sankalp committed 2026-03-12 00:27:51 +05:45
1 parent 05c8a3bd87
commit d67eae94d9
2 files changed
+5 -6

No files matched your search

+4 -6
View File
@@ -39,6 +39,8 @@ pub enum Commands {
}, },
/// Hardware status /// Hardware status
Status, Status,
/// Install udev rules for rootless operation
InstallRules,
} }
#[derive(Subcommand, Debug)] #[derive(Subcommand, Debug)]
@@ -95,9 +97,7 @@ pub enum PowerCommands {
/// Set power profile to battery saver /// Set power profile to battery saver
BatterySave, BatterySave,
/// Set CPU TDP limit (in Watts) /// Set CPU TDP limit (in Watts)
LimitTdp { LimitTdp { watts: u32 },
watts: u32,
},
} }
#[derive(Subcommand, Debug)] #[derive(Subcommand, Debug)]
@@ -113,9 +113,7 @@ pub enum CoolingCommands {
#[derive(Subcommand, Debug)] #[derive(Subcommand, Debug)]
pub enum BatteryCommands { pub enum BatteryCommands {
/// Set the battery charging limit (e.g., 80) /// Set the battery charging limit (e.g., 80)
Limit { Limit { percent: u8 },
percent: u8,
},
/// Show current battery status /// Show current battery status
Status, Status,
} }
+1
View File
@@ -31,5 +31,6 @@ fn main() {
Commands::Power { command } => commands::power::execute(command), Commands::Power { command } => commands::power::execute(command),
Commands::Cooling { command } => commands::cooling::execute(command), Commands::Cooling { command } => commands::cooling::execute(command),
Commands::Status => commands::status::execute(), Commands::Status => commands::status::execute(),
Commands::InstallRules => commands::install_rules::execute(),
} }
} }