#questions #prompt #ask #answer #cli

nightly bin+lib ask-cli

Ask CLI offers a simple way to ask a yes or no question

10 releases

0.3.0 Feb 16, 2024
0.2.1 Nov 19, 2023
0.2.0 Sep 11, 2023
0.1.6 Jul 12, 2023
0.1.1 Oct 31, 2022

#2223 in Command line utilities

Download history 35/week @ 2024-08-26 7/week @ 2024-09-02 4/week @ 2024-09-09 17/week @ 2024-09-16 39/week @ 2024-09-23 22/week @ 2024-09-30 23/week @ 2024-10-07 22/week @ 2024-10-14 18/week @ 2024-10-21 19/week @ 2024-10-28 23/week @ 2024-11-04 20/week @ 2024-11-11 23/week @ 2024-11-18 41/week @ 2024-11-25 23/week @ 2024-12-02 18/week @ 2024-12-09

105 downloads per month
Used in 2 crates

Apache-2.0

17KB
185 lines

Ask CLI

ask offers a simple way to ask a yes or no question on the CLI, returning exit code 0 on "yes" and 1 on "no".

Installation

Use prebuilt binaries

Binaries for a number of platforms are available on the release page.

Build from source

$ cargo +nightly install ask-cli

To install cargo, follow these instructions.

Usage

Ask the user a question:

$ ask Do you want to continue?
Do you want to continue? [Y/n] yes
$ echo $?
0

$ ask Do you want to continue?
Do you want to continue? [Y/n] n
$ echo $?
1

No runtime deps