ays

Crates.ioays
lib.rsays
version0.1.6
sourcesrc
created_at2022-11-17 21:55:26.028845
updated_at2023-06-13 07:57:58.039618
descriptionPipe stdin to stdout after user confirmation
homepagehttps://github.com/dpecos/ays
repositoryhttps://github.com/dpecos/ays
max_upload_size
id717512
size113,575
Daniel Pecos Martinez (dpecos)

documentation

README

AYS - Are You Sure?

About AYS

ays (Are You Sure?) is small command line application that asks the user for confirmation before piping its stdin into its stdout. If the user does not successfully confirm, ays writes EOF to its stdout.

ays is a great utility when defining shell aliases that you'd like to have a user confirmation before proceeding:

ays

I've personally found that ays is a great companion for fzf, but I'm pretty sure people will find other really interesting use cases. See some of my personal use cases down below.

Install

cargo install ays

Usage

ays [--preview] ["alternative prompt"]

If you'd like ays to use a different prompt message than the default "Are you sure?", you can specify it as its parameter (ays will append the closing question mark itself).

  • --preview: buffer the contents of the stdin and display it back to the user

Examples

Deleting git branches locally checked out

alias gbd="git for-each-ref --format='%(refname:short)' refs/heads/ | fzf --height=~20 | ays | xargs git branch -D"
Commit count: 21

cargo fmt