#ask #questions #prompt #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

#1785 in Command line utilities

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