(bdfd5f2) Apply color guidelines to codebase

This commit is contained in:
2026-05-15 19:11:05 +02:00
parent 75e9ea2309
commit 2a96abd3b0
4 changed files with 55 additions and 21 deletions
+24 -7
View File
@@ -62,8 +62,11 @@ pub fn cmd_ls(status_filter: &Option<String>, worklane_dir: &Path) -> Result<()>
println!(" [{}] {} {}", status.to_uppercase(), count, label);
}
// Show all tickets grouped by status
// Show all tickets except done grouped by status
for status in &statuses {
if *status == "done" {
continue;
}
let status_path = worklane_dir.join(status);
if !status_path.exists() || !fs::metadata(&status_path)?.is_dir() {
continue;
@@ -178,6 +181,7 @@ pub fn cmd_add(
println!("Created ticket: {}", filename);
Ok(())
}
fn read_comments(comments_dir: &Path) -> Result<Vec<(String, String, String, String)>> {
if !comments_dir.exists() {
return Ok(vec![]);
@@ -273,8 +277,8 @@ pub fn cmd_mv(ticket_id: &str, target_status: &str, force: bool, start: &Path) -
if !force && target_idx < current_idx {
return Err(anyhow!(
"Cannot move backward from {} to {}. Use --force (-f) to allow.",
current_status,
target_status
color_text(&current_status, "orange"),
color_text(target_status, "orange"),
));
}
@@ -285,7 +289,10 @@ pub fn cmd_mv(ticket_id: &str, target_status: &str, force: bool, start: &Path) -
}
if current_status == target_status {
println!("Ticket is already in '{}' status.", target_status);
println!(
"Ticket is already in '{}' status.",
color_text(&target_status, "orange")
);
return Ok(());
}
@@ -313,7 +320,10 @@ pub fn cmd_mv(ticket_id: &str, target_status: &str, force: bool, start: &Path) -
}
if found_filename.is_empty() {
return Err(anyhow!("Could not find ticket file in {}", current_status));
return Err(anyhow!(
"Could not find ticket file in {}",
color_text(&current_status, "orange")
));
}
// Read and update the ticket content
@@ -345,13 +355,20 @@ pub fn cmd_mv(ticket_id: &str, target_status: &str, force: bool, start: &Path) -
println!(
"Moved ticket '{}' from {} to {}",
title, current_status, target_status
color_text(&title, "green"),
color_text(&current_status, "orange"),
color_text(target_status, "orange"),
);
Ok(())
}
pub fn cmd_comment(ticket_id: &str, body: &str, owner: &Option<String>, start: &Path) -> Result<()> {
pub fn cmd_comment(
ticket_id: &str,
body: &str,
owner: &Option<String>,
start: &Path,
) -> Result<()> {
if body.is_empty() {
return Err(anyhow!("Comment body is required."));
}