From 0312929b1e4745f5e72d99e1ab6deadcac57e2a8 Mon Sep 17 00:00:00 2001 From: Rawleenc Date: Thu, 1 May 2025 21:37:05 +0200 Subject: [PATCH] feat: rename AddGroupsCommand to ConfigureGroupsCommand and update references --- src/lib.rs | 4 ++-- src/main.rs | 12 ++++++------ 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/src/lib.rs b/src/lib.rs index f00bd13..def8737 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -30,14 +30,14 @@ pub enum Commands { InstallRpmFusion, #[command(about = "Add groups to a user")] - AddGroups(AddGroupsCommand), + ConfigureGroups(ConfigureGroupsCommand), #[command(about = "Manage packages")] Package(PackageCommand), } #[derive(Args, Debug, PartialEq)] -pub struct AddGroupsCommand { +pub struct ConfigureGroupsCommand { #[arg( short, long, diff --git a/src/main.rs b/src/main.rs index e4fd790..1d2d228 100644 --- a/src/main.rs +++ b/src/main.rs @@ -33,9 +33,9 @@ fn main() { log::error!("Error installing RPM Fusion: {}", e); } } - Commands::AddGroups(add_user_command) => { - if let Err(e) = add_groups(add_user_command) { - log::error!("Error adding user to groups: {}", e); + Commands::ConfigureGroups(configure_groups_command) => { + if let Err(e) = configure_groups(configure_groups_command) { + log::error!("Error configuring groups: {}", e); } } Commands::Package(package_command) => { @@ -51,10 +51,10 @@ fn main() { success!("Bye :)"); } -fn add_groups(add_user_command: AddGroupsCommand) -> Result<()> { +fn configure_groups(configure_groups_command: ConfigureGroupsCommand) -> Result<()> { let groups = include_str!("../data/user_groups.txt").to_string(); - if add_user_command.print { + if configure_groups_command.print { log::info!("Printing groups..."); println!("{}", groups); return Ok(()); @@ -85,7 +85,7 @@ fn add_groups(add_user_command: AddGroupsCommand) -> Result<()> { let groups = groups.join(","); - let user = add_user_command.user.unwrap_or_else(|| { + let user = configure_groups_command.user.unwrap_or_else(|| { log::info!("No user specified, using current user"); whoami::username() });