mirror of
https://github.com/bootandy/dust.git
synced 2026-06-08 11:29:05 +03:00
Windows: If no color flag is already set
... then do not print a warning message https://github.com/bootandy/dust/issues/87
This commit is contained in:
@@ -20,6 +20,10 @@ static DEFAULT_NUMBER_OF_LINES: usize = 30;
|
||||
|
||||
#[cfg(windows)]
|
||||
fn init_color(no_color: bool) -> bool {
|
||||
// If no color is already set do not print a warning message
|
||||
if no_color {
|
||||
true
|
||||
} else {
|
||||
// Required for windows 10
|
||||
// Fails to resolve for windows 8 so disable color
|
||||
match ansi_term::enable_ansi_support() {
|
||||
@@ -32,6 +36,7 @@ fn init_color(no_color: bool) -> bool {
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#[cfg(not(windows))]
|
||||
fn init_color(no_color: bool) -> bool {
|
||||
|
||||
Reference in New Issue
Block a user