mirror of
https://github.com/bootandy/dust.git
synced 2026-06-08 11:29:05 +03:00
Bring over dev/inode pair changes from bootandy's repo
This commit is contained in:
+8
-2
@@ -10,7 +10,7 @@ use clap::{App, AppSettings, Arg};
|
||||
static DEFAULT_NUMBER_OF_LINES: &'static str = "15";
|
||||
|
||||
fn main() {
|
||||
let options = App::new("Trailing args example")
|
||||
let options = App::new("Dust")
|
||||
.setting(AppSettings::TrailingVarArg)
|
||||
.arg(
|
||||
Arg::with_name("number_of_lines")
|
||||
@@ -19,6 +19,11 @@ fn main() {
|
||||
.takes_value(true)
|
||||
.default_value(DEFAULT_NUMBER_OF_LINES),
|
||||
)
|
||||
.arg(
|
||||
Arg::with_name("use_apparent_size")
|
||||
.short("s")
|
||||
.help("If set will use file length. Otherwise we use blocks"),
|
||||
)
|
||||
.arg(Arg::with_name("inputs").multiple(true))
|
||||
.get_matches();
|
||||
|
||||
@@ -29,8 +34,9 @@ fn main() {
|
||||
}
|
||||
};
|
||||
let number_of_lines = value_t!(options.value_of("number_of_lines"), usize).unwrap();
|
||||
let use_apparent_size = options.is_present("use_apparent_size");
|
||||
|
||||
let (permissions, results) = get_dir_tree(&filenames);
|
||||
let (permissions, results) = get_dir_tree(&filenames, use_apparent_size);
|
||||
let slice_it = find_big_ones(&results, number_of_lines);
|
||||
display(permissions, &slice_it);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user