mirror of
https://github.com/bootandy/dust.git
synced 2026-06-08 11:29:05 +03:00
Fix colors on windows
* Initialize ansi_term if we're on windows * Silence build warning on non-unix targets * Update ansi-term which has windows specific fixes (and assert_cli while I'm at it)
This commit is contained in:
committed by
andy.boot
parent
da61b15715
commit
38938e005e
@@ -11,7 +11,16 @@ mod utils;
|
||||
|
||||
static DEFAULT_NUMBER_OF_LINES: usize = 20;
|
||||
|
||||
#[cfg(windows)]
|
||||
fn init_color() {
|
||||
ansi_term::enable_ansi_support().expect("Couldn't enable color support");
|
||||
}
|
||||
|
||||
#[cfg(not(windows))]
|
||||
fn init_color() {}
|
||||
|
||||
fn main() {
|
||||
init_color();
|
||||
let def_num_str = DEFAULT_NUMBER_OF_LINES.to_string();
|
||||
let options = App::new("Dust")
|
||||
.about("Like du but more intuitive")
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
use jwalk::DirEntry;
|
||||
|
||||
#[cfg(target_family = "unix")]
|
||||
fn get_block_size() -> u64 {
|
||||
// All os specific implementations of MetatdataExt seem to define a block as 512 bytes
|
||||
// https://doc.rust-lang.org/std/os/linux/fs/trait.MetadataExt.html#tymethod.st_blocks
|
||||
|
||||
Reference in New Issue
Block a user