(bdfd5f2) Apply color guidelines to codebase
This commit is contained in:
+24
-7
@@ -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(¤t_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(¤t_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(¤t_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."));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user