This function is inspired by (if not mostly copied from) usethis::ui_yeah function. It's purpose is to ask user a yes/no question. The differences are:
It is more limited in answer options customization. This is done on purpose to standardize command line dialogues in our code.
It uses
clipackage under the hood, soclirich text formatting is possible.
Usage
cli_yeah(x, straight = FALSE, .envir = parent.frame())Arguments
- x
Question to display.
- straight
(logical) Ask a straight Yes/No question? By default (when
FALSE), two different "no" options and one "yes" option are sampled from a pool of variants. In other words it behaves just like usethis::ui_yeah with default parameter setup. Whenstraight = TRUE, it only shows "Yes" and "No", literally.- .envir
Environment to evaluate the glue expressions in.