Ask
A simple toolset for asking questions through the terminal.
Usage
Add Ask
as a dependency in your Cargo.toml
[]
=0.0.1
Examples:
extern crate ask;
use ;
should show:
A simple toolset for asking questions through the terminal.
Add Ask
as a dependency in your Cargo.toml
[dependencies]
ask=0.0.1
Examples:
extern crate ask;
use ask::question::{OpenEnded, MultipleChoice, TraitQuestion};
fn main() {
let mut open_ended = OpenEnded::new("question?".to_string());
let answers = open_ended.send();
let mut multiple_choice = MultipleChoice::new("question?".to_string());
let answers = multiple_choice.add_option("option 1".to_owned())
.add_option("option 2".to_owned())
.add_option("option 3".to_owned())
.max_selections(2)
.min_selections(1)
.send()
.unwrap();
for answer in answers{
println!("{:?}", answer);
}
}
should show: