1
0
Fork 0
forked from wry/wry

cli: add value hints for better completions

This commit is contained in:
Julian Orth 2025-01-26 19:47:36 +01:00
parent 67549d8cb3
commit 9de5a8b2c9
2 changed files with 6 additions and 4 deletions

View file

@ -25,7 +25,7 @@ use {
portal,
},
::log::Level,
clap::{builder::PossibleValue, Args, Parser, Subcommand, ValueEnum},
clap::{builder::PossibleValue, Args, Parser, Subcommand, ValueEnum, ValueHint},
clap_complete::Shell,
};
@ -97,7 +97,7 @@ pub struct IdleArgs {
#[derive(Args, Debug)]
pub struct RunPrivilegedArgs {
/// The program to run
#[clap(required = true)]
#[clap(required = true, trailing_var_arg = true, value_hint = ValueHint::CommandWithArguments)]
pub program: Vec<String>,
}
@ -121,6 +121,7 @@ pub struct ScreenshotArgs {
/// in the current directory.
///
/// The filename can contain the usual strftime parameters.
#[clap(value_hint = ValueHint::FilePath)]
pub filename: Option<String>,
}