Library to support inquire_derive
via proc-macro
.
- Derive support for inquire see #supported.
- Original feature request inquire #65
- Text
- Select
- MultiSelect
- CustomType
- Editor
- Password
- Confirm
- DateSelect
- Nested
Click to show Cargo.toml.
[dependencies]
# The inquire derive crate
inquire = { version = "0.5.2" }
inquire_derive = { git = "https://github.com/IniterWorker/inquire_derive", branch = "master" }
use inquire_derive::InquireForm;
#[derive(Debug, InquireForm)]
pub struct Demo {
#[inquire(text(
prompt_message = "\"What's your path?\"",
initial_value = "\"/my/initial/path\"",
placeholder_value = "\"/my/placeholder/path\"",
))]
pub path: String,
}
impl Default for Demo {
fn default() -> Self {
Self {
path: "/my/default/path".to_string(),
}
}
}
fn main() {
let mut ex = Demo::default();
println!("{:?}", ex.inquire_mut().unwrap());
}
- Text:
cargo run --example text
- Select:
cargo run --example select
- MultiSelect:
cargo run --example multi_select
- CustomType:
cargo run --example custom_type
- Editor:
cargo run --example editor
- Password:
cargo run --example password
- Confirm:
cargo run --example confirm
- DateSelect:
cargo run --example date_select
- Form(Nested):
cargo run --example form
See LICENSE for details.