-
Notifications
You must be signed in to change notification settings - Fork 70
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
vec-last
ignored when only 2 elements are provided
#681
Labels
bug
an unexpected problem or unintended behavior
tidy-dev-day 🤓
Tidyverse Developer Day rstd.io/tidy-dev-day
Comments
Hi! Kind regards |
gaborcsardi
added
the
tidy-dev-day 🤓
Tidyverse Developer Day rstd.io/tidy-dev-day
label
Jul 17, 2024
Fixing this is probably a breaking change. There is also a workaround already: v <- cli::cli_vec(
c("foo", "bar"),
style = list("vec-last" = " or ", "vec-sep2" = " or ")
)
cli::cli_text("Must be one of: {v}.")
which is also appropriate if you want Oxford comma: v <- cli::cli_vec(
c("foo", "bar"),
style = list("vec-last" = ", or ", "vec-sep2" = " or ")
)
cli::cli_text("Must be one of: {v}.") Another workaround is to use the v <- c("foo", "bar")
cli::cli_text("Must be one of: {.or {v}}.")
|
gaborcsardi
added a commit
to rundel/cli
that referenced
this issue
Aug 28, 2024
Another fix for r-lib#681.
Closed by #718. |
jennybc
added a commit
to r-lib/usethis
that referenced
this issue
Nov 22, 2024
Approach taken from r-lib/cli#681 (comment)
jennybc
added a commit
to r-lib/usethis
that referenced
this issue
Nov 25, 2024
* Get use_vignette() working for qmd * Another test * Attempt to get "or" between 2 .vals Approach taken from r-lib/cli#681 (comment) * Catch up on the article side * Add NEWS bullet * Remove comment
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
bug
an unexpected problem or unintended behavior
tidy-dev-day 🤓
Tidyverse Developer Day rstd.io/tidy-dev-day
cli_vec()
is very helpful when informing uses that they should choose one of a set of values. Usingvec-last
is great because it allows us to sayor {last-item}
meaning it is one of the options not all of them. However, when only two elements are providedcli_vec()
always says "and".Can it be fixed such that
vec-last
is used when the vector length is > 1?Created on 2024-03-21 with reprex v2.0.2
The text was updated successfully, but these errors were encountered: