We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Thanks for this crate!
It isn't clear (to me) from the documentation how to tell Klask to use a native dialog for a PathBuf argument.
PathBuf
I noticed the following:
use std::path::PathBuf; use clap::{Arg, App, ValueHint}; use klask::Settings; fn main() { // Displays path picker let app = App::new("Foo").arg(Arg::new("path").value_hint(ValueHint::FilePath)); klask::run_app(app, Settings::default(), |matches| println!("Path: {:?}", matches.get_one::<PathBuf>("path"))) } fn main() { // Displays string field #[derive(clap::Parser)] struct Args { path: PathBuf } klask::run_derived::<Args, _>(Settings::default(), |args| println!("Path: {:?}", args.path)) }
Is it possible to trigger the native dialog without supplying a ValueHint directly? If so, this could be helpful to note in the docs.
ValueHint
The text was updated successfully, but these errors were encountered:
I just realized the Arg in the first snippet also needs .value_parser(value_parser!(PathBuf)) to work correctly.
Arg
.value_parser(value_parser!(PathBuf))
Sorry, something went wrong.
No branches or pull requests
Thanks for this crate!
It isn't clear (to me) from the documentation how to tell Klask to use a native dialog for a
PathBuf
argument.I noticed the following:
Is it possible to trigger the native dialog without supplying a
ValueHint
directly? If so, this could be helpful to note in the docs.The text was updated successfully, but these errors were encountered: