From 7afab287bd84263f0cebab82ca11adef889b6bc7 Mon Sep 17 00:00:00 2001 From: JMARyA Date: Sun, 26 Jan 2025 16:02:50 +0100 Subject: [PATCH] todo stress level --- README.md | 2 +- src/git.rs | 1 + src/main.rs | 19 ++++++++++++++++++- 3 files changed, 20 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index e067f1c..e6bbe0a 100644 --- a/README.md +++ b/README.md @@ -83,7 +83,7 @@ Welcome to `g`, the ultimate Git wrapper for the hustlers. Inspired by the TOP G Commit changes. - - `-all` adds all changed files to Git. + - `--all` adds all changed files to Git. - `--done` refuses to commit with open TODOs. diff --git a/src/git.rs b/src/git.rs index 6b23b5b..775aa8b 100644 --- a/src/git.rs +++ b/src/git.rs @@ -36,6 +36,7 @@ pub fn create_new_branch(branch: &str) { /// Push the current repository to remote pub fn push(force: bool) { + // TODO : Refuse push if WIP commit present let mut cmd = Exec::cmd("git") .arg("push") .arg("--set-upstream") diff --git a/src/main.rs b/src/main.rs index 10b97e5..894583d 100644 --- a/src/main.rs +++ b/src/main.rs @@ -76,7 +76,24 @@ pub fn show_todos() { if amount == 0 { println!("{}", "✨ No TODOs 🍃".paint(Color::Green).bold()); } else { - println!("{} TODOs found.", amount); + let emoji = match amount { + 1..=5 => "🌱", + 6..=9 => "🙂", + 10..=19 => "😅", + 20..=49 => "🔥", + 50..100 => "🤯", + 100.. => "💀", + _ => "💀", + }; + + println!( + "{emoji} {} TODOs found.", + if amount < 20 { + amount.paint(Color::Yellow).bold() + } else { + amount.paint(Color::Red).bold() + } + ); show_rg(TODO_REGEX); } }