diff --git a/rage/src/bin/rage-keygen/cli.rs b/rage/src/bin/rage-keygen/cli.rs index fe07d08b..f54eb317 100644 --- a/rage/src/bin/rage-keygen/cli.rs +++ b/rage/src/bin/rage-keygen/cli.rs @@ -1,4 +1,7 @@ -use clap::{builder::Styles, ArgAction, Parser}; +use clap::{ + builder::{Styles, ValueHint}, + ArgAction, Parser, +}; use crate::fl; @@ -22,6 +25,7 @@ pub(crate) struct AgeOptions { #[arg(help_heading = fl!("args-header"))] #[arg(value_name = fl!("input"))] #[arg(help = fl!("help-arg-input"))] + #[arg(value_hint = ValueHint::FilePath)] pub(crate) input: Option, #[arg(action = ArgAction::Help, short, long)] @@ -35,6 +39,7 @@ pub(crate) struct AgeOptions { #[arg(short, long)] #[arg(value_name = fl!("output"))] #[arg(help = fl!("keygen-help-flag-output"))] + #[arg(value_hint = ValueHint::DirPath)] pub(crate) output: Option, #[arg(short = 'y')] diff --git a/rage/src/bin/rage-mount/cli.rs b/rage/src/bin/rage-mount/cli.rs index 0cb65dba..66e4099a 100644 --- a/rage/src/bin/rage-mount/cli.rs +++ b/rage/src/bin/rage-mount/cli.rs @@ -1,4 +1,7 @@ -use clap::{builder::Styles, ArgAction, Parser}; +use clap::{ + builder::{Styles, ValueHint}, + ArgAction, Parser, +}; use crate::fl; @@ -24,11 +27,13 @@ pub(crate) struct AgeMountOptions { #[arg(help_heading = fl!("args-header"))] #[arg(value_name = fl!("mnt-filename"))] #[arg(help = fl!("help-arg-mnt-filename"))] + #[arg(value_hint = ValueHint::FilePath)] pub(crate) filename: String, #[arg(help_heading = fl!("args-header"))] #[arg(value_name = fl!("mnt-mountpoint"))] #[arg(help = fl!("help-arg-mnt-mountpoint"))] + #[arg(value_hint = ValueHint::DirPath)] pub(crate) mountpoint: String, #[arg(action = ArgAction::Help, short, long)] @@ -51,5 +56,6 @@ pub(crate) struct AgeMountOptions { #[arg(short, long)] #[arg(value_name = fl!("identity"))] #[arg(help = fl!("help-flag-identity"))] + #[arg(value_hint = ValueHint::FilePath)] pub(crate) identity: Vec, } diff --git a/rage/src/bin/rage/cli.rs b/rage/src/bin/rage/cli.rs index d01c7f46..1084ce5a 100644 --- a/rage/src/bin/rage/cli.rs +++ b/rage/src/bin/rage/cli.rs @@ -1,6 +1,9 @@ use std::path::Path; -use clap::{builder::Styles, ArgAction, Parser}; +use clap::{ + builder::{Styles, ValueHint}, + ArgAction, Parser, +}; use crate::fl; @@ -99,6 +102,7 @@ pub(crate) struct AgeOptions { #[arg(help_heading = fl!("args-header"))] #[arg(value_name = fl!("input"))] #[arg(help = fl!("help-arg-input"))] + #[arg(value_hint = ValueHint::FilePath)] pub(crate) input: Option, #[arg(action = ArgAction::Help, short, long)] @@ -137,11 +141,13 @@ pub(crate) struct AgeOptions { #[arg(short = 'R', long)] #[arg(value_name = fl!("recipients-file"))] #[arg(help = fl!("help-flag-recipients-file"))] + #[arg(value_hint = ValueHint::FilePath)] pub(crate) recipients_file: Vec, #[arg(short, long)] #[arg(value_name = fl!("identity"))] #[arg(help = fl!("help-flag-identity"))] + #[arg(value_hint = ValueHint::FilePath)] pub(crate) identity: Vec, #[arg(short = 'j')] @@ -152,5 +158,6 @@ pub(crate) struct AgeOptions { #[arg(short, long)] #[arg(value_name = fl!("output"))] #[arg(help = fl!("help-flag-output"))] + #[arg(value_hint = ValueHint::AnyPath)] pub(crate) output: Option, }