#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

#2390 in Command line utilities

Download history 17/week @ 2024-11-13 27/week @ 2024-11-20 34/week @ 2024-11-27 24/week @ 2024-12-04 25/week @ 2024-12-11 12/week @ 2024-12-18 15/week @ 2025-01-01 27/week @ 2025-01-08 3/week @ 2025-01-15 10/week @ 2025-01-22 8/week @ 2025-01-29 16/week @ 2025-02-05 28/week @ 2025-02-12 31/week @ 2025-02-19 45/week @ 2025-02-26

121 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