summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRoy Ivy III <rivy.dev@gmail.com>2020-07-06 09:22:19 -0500
committerRoy Ivy III <rivy.dev@gmail.com>2020-07-06 09:22:19 -0500
commit2c73b4d59603c12d31ded1a2f2ca9ef97a5ff0b3 (patch)
treeb131e527bbc7e2302b8cd457c57293cb12155817
parent5a11216b53af2644100fcfebe44b0b6eea2dbb78 (diff)
add windows wildcard argument support (using `wild`)
-rw-r--r--Cargo.toml1
-rw-r--r--src/main.rs3
2 files changed, 3 insertions, 1 deletions
diff --git a/Cargo.toml b/Cargo.toml
index 9c90834..dbe2160 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -35,6 +35,7 @@ crosstermion = { optional = true, version = "0.1.3", default-features = false }
tui = { version = "0.9.1", optional = true, default-features = false }
tui-react = { version = "0.4", optional = true }
open = { version = "1.2.2", optional = true }
+wild = "2.0.4"
[[bin]]
name="dua"
diff --git a/src/main.rs b/src/main.rs
index a47fc22..9c680a3 100644
--- a/src/main.rs
+++ b/src/main.rs
@@ -4,6 +4,7 @@ use anyhow::Result;
use dua::{ByteFormat, Color, TraversalSorting};
use std::{fs, io, io::Write, path::PathBuf, process};
use structopt::StructOpt;
+use wild;
#[cfg(any(feature = "tui-unix", feature = "tui-crossplatform"))]
mod interactive;
@@ -12,7 +13,7 @@ mod options;
fn main() -> Result<()> {
use options::Command::*;
- let opt: options::Args = options::Args::from_args();
+ let opt: options::Args = options::Args::from_iter(wild::args_os());
let walk_options = dua::WalkOptions {
threads: opt.threads.unwrap_or(0),
byte_format: opt.format.map(Into::into).unwrap_or(ByteFormat::Metric),