From 93ee8b48bf5c050e1cbc9c86950f2a237f8e5f6b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Egehan=20Karap=C4=B1nar?= Date: Wed, 24 Sep 2025 22:57:00 +0300 Subject: [PATCH 1/4] Couple of grammar fixes for a better UX. --- src/main.rs | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/src/main.rs b/src/main.rs index 3315c36..e988f14 100644 --- a/src/main.rs +++ b/src/main.rs @@ -21,14 +21,14 @@ fn main() { } let matchy = clap::Command::new("thinkfan-cli") .version("0.1.2") - .about("controlling thinkpad fan using command line tool") + .about("A Versatile Fan Control Utility for ThinkPad") .author("rahmedi rahmedyev@gmail.com") .arg( Arg::new("set") .short('s') .long("set") .required(false) - .help("Set fan rate\nAvailable commands:\n1~7: is fan levels\nauto: automatic mode\nfull-speed: sets fan to full-speed\ndisengaged: sets fan to its maximum speed\nenable: enables fan control\ndisable: disables fan control\n\nExamples:\nthinkfan-cli -s 7\nthinkfan-cli -s disengaged")) + .help("Set fan rate\nAvailable commands:\n1~7: is fan levels\nauto: automatic mode\nfull-speed: sets fan to full-speed\extreme: sets fan to its maximum speed\nenable: enables fan control\ndisable: disables fan control\n\nExamples:\nthinkfan-cli -s 7\nthinkfan-cli -s disengaged")) .arg( Arg::new("fetch") .short('f') @@ -45,7 +45,7 @@ fn main() { let userinput = match matchy.get_one::("set") { Some(set) => set.clone(), None => { - eprintln!("{}",format!("Input is not valid! try with -h").red()); + eprintln!("{}",format!("Invalid input! Try with -h").red()); return; } }; @@ -59,7 +59,7 @@ fn main() { "6", "7", "auto", - "disengaged", + "extreme", "full-speed", "enable", "disable", @@ -73,13 +73,13 @@ fn main() { eprintln!(" 0-7 : Fan levels"); eprintln!(" auto : Automatic mode"); eprintln!(" full-speed : Full speed"); - eprintln!(" disengaged : Maximum speed"); + eprintln!(" extreme : Maximum speed"); eprintln!(" enable : Enable fan control"); eprintln!(" disable : Disable fan control"); eprintln!("\n{}", "Examples:".yellow()); eprintln!(" thinkfan-cli -s 7"); eprintln!(" thinkfan-cli -s auto"); - eprintln!(" thinkfan-cli -s disengaged"); + eprintln!(" thinkfan-cli -s extreme"); return; } }; @@ -90,7 +90,7 @@ fn main() { fan_level(inputbool); } -// We gonna check fan control file for reducing errors +// We're gonna check fan control file to avoid errors. fn check_file() -> bool { let fan_path = "/proc/acpi/ibm/fan"; std::path::Path::new(fan_path).exists() @@ -103,7 +103,7 @@ fn fetch() { } } -// We interacting with control file for setting fan levels +// We're using the control file for setting fan levels fn fan_level(level: String) { let fan_path_true = match check_file() { true => "/proc/acpi/ibm/fan", From 83892bda5950099e11684d31a2d6147a7a372218 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Egehan=20Karap=C4=B1nar?= Date: Wed, 24 Sep 2025 23:07:18 +0300 Subject: [PATCH 2/4] (v2) --- src/main.rs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/main.rs b/src/main.rs index e988f14..3c35913 100644 --- a/src/main.rs +++ b/src/main.rs @@ -90,7 +90,7 @@ fn main() { fan_level(inputbool); } -// We're gonna check fan control file to avoid errors. +// We're gonna check the fan control file to avoid errors. fn check_file() -> bool { let fan_path = "/proc/acpi/ibm/fan"; std::path::Path::new(fan_path).exists() @@ -108,7 +108,7 @@ fn fan_level(level: String) { let fan_path_true = match check_file() { true => "/proc/acpi/ibm/fan", false => { - let error = format!("Error, Control file is not available").red(); + let error = format!("Error, Control file missing.").red(); eprintln!("{}", error); return; } @@ -129,14 +129,14 @@ fn check_module() -> bool{ if content == "Y" { true }else if content == "N"{ - eprintln!("Hey, did you enabled the thinkpad_acpi module? Seems like you didnt."); + eprintln!("Hey, did you enable the thinkpad_acpi module? Seems like you didn't."); false }else { println!("Unknown value {} :(", content); false } }Err(e) => { - eprintln!("Failed to read file, do you using a thinkpad? (line 133) ({})", e); + eprintln!("Failed to read file, are you using a ThinkPad? (line 133) ({})", e); false } } From f1a3a6ec1474077dfa69c825c2f70dee187b7671 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Egehan=20Karap=C4=B1nar?= Date: Wed, 24 Sep 2025 23:09:24 +0300 Subject: [PATCH 3/4] (v3) --- src/main.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main.rs b/src/main.rs index 3c35913..13f61f1 100644 --- a/src/main.rs +++ b/src/main.rs @@ -129,14 +129,14 @@ fn check_module() -> bool{ if content == "Y" { true }else if content == "N"{ - eprintln!("Hey, did you enable the thinkpad_acpi module? Seems like you didn't."); + eprintln!("Hey, did you enable the thinkpad_acpi module? It appears you didn't."); false }else { println!("Unknown value {} :(", content); false } }Err(e) => { - eprintln!("Failed to read file, are you using a ThinkPad? (line 133) ({})", e); + eprintln!("Failed to read the file, are you using a ThinkPad? (line 133) ({})", e); false } } From b072a90d433a7354016c9051def6f3e9e7e5179c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Egehan=20Karap=C4=B1nar?= Date: Sun, 28 Sep 2025 18:34:51 +0300 Subject: [PATCH 4/4] Update main.rs --- src/main.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/main.rs b/src/main.rs index 13f61f1..253e00f 100644 --- a/src/main.rs +++ b/src/main.rs @@ -28,7 +28,7 @@ fn main() { .short('s') .long("set") .required(false) - .help("Set fan rate\nAvailable commands:\n1~7: is fan levels\nauto: automatic mode\nfull-speed: sets fan to full-speed\extreme: sets fan to its maximum speed\nenable: enables fan control\ndisable: disables fan control\n\nExamples:\nthinkfan-cli -s 7\nthinkfan-cli -s disengaged")) + .help("Set fan rate\nAvailable commands:\n1~7: is fan levels\nauto: automatic mode\nfull-speed: sets fan to full-speed\disengaged: sets fan to its maximum speed\nenable: enables fan control\ndisable: disables fan control\n\nExamples:\nthinkfan-cli -s 7\nthinkfan-cli -s disengaged")) .arg( Arg::new("fetch") .short('f') @@ -59,7 +59,7 @@ fn main() { "6", "7", "auto", - "extreme", + "disengaged", "full-speed", "enable", "disable", @@ -79,7 +79,7 @@ fn main() { eprintln!("\n{}", "Examples:".yellow()); eprintln!(" thinkfan-cli -s 7"); eprintln!(" thinkfan-cli -s auto"); - eprintln!(" thinkfan-cli -s extreme"); + eprintln!(" thinkfan-cli -s disengaged"); return; } };