From 9f5fe4d01e888967b2fa0c59327e57af69a899bc Mon Sep 17 00:00:00 2001 From: bootandy Date: Fri, 16 Mar 2018 16:05:42 -0400 Subject: [PATCH] clean up --- Cargo.toml | 2 +- README.md | 8 ++++++-- src/main.rs | 12 ++++++------ 3 files changed, 13 insertions(+), 9 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index b6cf817..d175e89 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,5 +1,5 @@ [package] -name = "dus" +name = "dust" version = "0.1.0" authors = ["bootandy "] diff --git a/README.md b/README.md index 1b1ef32..847ca2b 100644 --- a/README.md +++ b/README.md @@ -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. diff --git a/src/main.rs b/src/main.rs index 947d69f..c0e75bd 100644 --- a/src/main.rs +++ b/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>( 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 {