https://github.com/supercilex/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".
https://github.com/supercilex/ask-cli
ask bash cli rust
Last synced: 2 months ago
JSON representation
`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".
- Host: GitHub
- URL: https://github.com/supercilex/ask-cli
- Owner: SUPERCILEX
- License: apache-2.0
- Created: 2022-10-30T08:50:39.000Z (over 3 years ago)
- Default Branch: master
- Last Pushed: 2024-12-28T05:51:59.000Z (over 1 year ago)
- Last Synced: 2025-08-31T04:28:32.290Z (10 months ago)
- Topics: ask, bash, cli, rust
- Language: Rust
- Homepage: https://crates.io/crates/ask-cli
- Size: 131 KB
- Stars: 4
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Funding: .github/FUNDING.yml
- License: LICENSE
Awesome Lists containing this project
README
# 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](https://github.com/SUPERCILEX/ask-cli/releases/latest).
### Build from source
```console,ignore
$ cargo +nightly install ask-cli
```
> To install cargo, follow [these instructions](https://doc.rust-lang.org/cargo/getting-started/installation.html).
## Usage
Ask the user a question:
```bash
$ 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
```