mirror of
https://github.com/bootandy/dust.git
synced 2025-12-05 20:40:11 -08:00
clean up
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
[package]
|
||||
name = "dus"
|
||||
name = "dust"
|
||||
version = "0.1.0"
|
||||
authors = ["bootandy <bootandy@gmail.com>"]
|
||||
|
||||
|
||||
@@ -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.
|
||||
|
||||
|
||||
12
src/main.rs
12
src/main.rs
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user