summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDoug Elkin <doug@dougelkin.com>2022-09-08 23:33:58 -0400
committerAbin Simon <abinsimon10@gmail.com>2022-09-10 12:01:11 +0530
commit0d8c2c4d9c72efc8344ef08009bb679a6e6de82f (patch)
tree52cdf4416a8eb78daf26ae1f73f989282eaec513
parenta2cabdf5b9ee3cbc40fe8538ee56537dbf68f95b (diff)
use ValueHint::AnyPath on FILE argument
This fixes an issue with path completion in ZSH.
-rw-r--r--src/app.rs9
1 files changed, 7 insertions, 2 deletions
diff --git a/src/app.rs b/src/app.rs
index 29909eb..1e9357f 100644
--- a/src/app.rs
+++ b/src/app.rs
@@ -1,10 +1,15 @@
-use clap::{App, Arg};
+use clap::{App, Arg, ValueHint};
pub fn build() -> App<'static> {
App::new("lsd")
.version(env!("CARGO_PKG_VERSION"))
.about(env!("CARGO_PKG_DESCRIPTION"))
- .arg(Arg::with_name("FILE").multiple(true).default_value("."))
+ .arg(
+ Arg::with_name("FILE")
+ .multiple(true)
+ .default_value(".")
+ .value_hint(ValueHint::AnyPath),
+ )
.arg(
Arg::with_name("all")
.short('a')