This commit is contained in:
bootandy
2018-03-16 16:05:42 -04:00
parent 8356cc6e1b
commit 9f5fe4d01e
3 changed files with 13 additions and 9 deletions

View File

@@ -1,5 +1,5 @@
[package]
name = "dus"
name = "dust"
version = "0.1.0"
authors = ["bootandy <bootandy@gmail.com>"]

View File

@@ -1,5 +1,9 @@
# dus
a rust alternative to du
# Dust
du + rust = dust. A rust alternative to du
unlike du, dust is meant to give you an instant overview of which directories are using disk space.
du is good when combined with sort and head. Dust is an all in one command.
do not use. strickly experimental for me messing around with rust.

View File

@@ -8,8 +8,6 @@ extern crate ansi_term;
#[macro_use]
extern crate clap;
use std::str::Split;
use std::collections::HashMap;
use std::collections::HashSet;
use ansi_term::Colour::Fixed;
@@ -85,7 +83,12 @@ fn main() {
.arg(Arg::with_name("inputs").multiple(true))
.get_matches();
let filenames: Vec<&str> = options.values_of("inputs").unwrap().collect();
let filenames = {
match options.values_of("inputs") {
None => vec!["."],
Some(r) => r.collect(),
}
};
let number_of_lines = value_t!(options.value_of("number_of_lines"), usize).unwrap();
let mut permissions = true;
@@ -285,9 +288,6 @@ fn display_node<S: Into<String>>(
if node.dir.name.matches("/").count() == printable_node_slashes + 1 {
num_sibblings -= 1;
let tree_chars = {
/*if num_sibblings == 0 {
" "
} else*/
if num_sibblings == 0 {
"└──"
} else {