feat: CLI UX overhaul with colored output, timing, shorthands, and fuzzy suggestions
Add polished CLI output across all commands: colored help text, green/red pass/fail indicators (✓/✗), elapsed timing on compile/check/test/fmt, command shorthands (c/t/f/s/k), fuzzy "did you mean?" on typos, and smart port-in-use suggestions for serve. Respects NO_COLOR/TERM=dumb. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -224,10 +224,31 @@ pub mod colors {
|
||||
pub const BOLD: &str = "\x1b[1m";
|
||||
pub const DIM: &str = "\x1b[2m";
|
||||
pub const RED: &str = "\x1b[31m";
|
||||
pub const GREEN: &str = "\x1b[32m";
|
||||
pub const YELLOW: &str = "\x1b[33m";
|
||||
pub const BLUE: &str = "\x1b[34m";
|
||||
pub const MAGENTA: &str = "\x1b[35m";
|
||||
pub const CYAN: &str = "\x1b[36m";
|
||||
pub const WHITE: &str = "\x1b[37m";
|
||||
pub const GRAY: &str = "\x1b[90m";
|
||||
}
|
||||
|
||||
/// Apply color to text, respecting NO_COLOR / TERM=dumb
|
||||
pub fn c(color: &str, text: &str) -> String {
|
||||
if supports_color() {
|
||||
format!("{}{}{}", color, text, colors::RESET)
|
||||
} else {
|
||||
text.to_string()
|
||||
}
|
||||
}
|
||||
|
||||
/// Apply bold + color to text
|
||||
pub fn bc(color: &str, text: &str) -> String {
|
||||
if supports_color() {
|
||||
format!("{}{}{}{}", colors::BOLD, color, text, colors::RESET)
|
||||
} else {
|
||||
text.to_string()
|
||||
}
|
||||
}
|
||||
|
||||
/// Severity level for diagnostics
|
||||
|
||||
Reference in New Issue
Block a user