#ask #answer #cli #prompt


Ask a question, what more could you want?

4 releases

Uses old Rust 2015

0.2.2 May 8, 2018
0.2.1 Nov 9, 2017
0.2.0 Nov 5, 2017
0.1.0 Nov 2, 2017

#374 in Command-line interface

Download history 3364/week @ 2023-06-07 2369/week @ 2023-06-14 2123/week @ 2023-06-21 1619/week @ 2023-06-28 2210/week @ 2023-07-05 2994/week @ 2023-07-12 2133/week @ 2023-07-19 2567/week @ 2023-07-26 2407/week @ 2023-08-02 1630/week @ 2023-08-09 1956/week @ 2023-08-16 2007/week @ 2023-08-23 2273/week @ 2023-08-30 1939/week @ 2023-09-06 2685/week @ 2023-09-13 3140/week @ 2023-09-20

10,609 downloads per month
Used in 22 crates

MIT license

495 lines


Crates.io Crates.io license Coverage Status

Linux: Build status Windows: Build status

A Command Line Question Asker for Rust.

Ask a question, what more could you want?

Easy to use library for asking users questions when writing console/terminal applications.


Add question as a dependency in your Cargo.toml to use from crates.io:

question = "0.2.2"

Then add extern crate question; to your crate root and run cargo build or cargo update && cargo build for your project. Detailed documentation for releases can be found on docs.rs and the bleeding edge docs for the latest GitLab repository version can be found on GitLab pages.


extern crate question;
use question::{Answer, Question};

fn main() {
    let answer = Question::new("Continue?")

    if answer == Answer::YES {
        println!("Onward then!");
    } else {

Examples can also be ran directly:

$ cargo run --example yes_no_with_defaults
    Finished dev [unoptimized + debuginfo] target(s) in 0.0 secs
     Running `target/debug/examples/yes_no_with_defaults`
Continue? (Y/n) why
Continue? (Y/n) y
Onward then!

See examples for more.


The project is mirrored to GitHub, but all development is done on GitLab. Please use the GitLab issue tracker. Don't have a GitLab account? Just email incoming+starshell/question@gitlab.com and those emails automatically become issues (with the comments becoming the email conversation).

To contribute to Question, please see CONTRIBUTING.


Question is distributed under the terms of both the MIT license. If this does not suit your needs for some reason please feel free to contact me, or open an issue.



~30K SLoC