#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

#1822 in Command line utilities

Download history 168/week @ 2024-02-15 29/week @ 2024-02-22 4/week @ 2024-02-29 5/week @ 2024-03-07 19/week @ 2024-03-14 6/week @ 2024-03-28 4/week @ 2024-04-04

60 downloads per month

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