Skip to content

Switch to cli and use clickable links#74

Merged
hadley merged 8 commits intomainfrom
cli
Jan 10, 2023
Merged

Switch to cli and use clickable links#74
hadley merged 8 commits intomainfrom
cli

Conversation

@hadley
Copy link
Member

@hadley hadley commented Oct 7, 2022

No description provided.

@hadley hadley requested a review from gaborcsardi October 10, 2022 15:47
prefer_bullets <- function(pkgs, name) {
prefer <- map_chr(pkgs, function(pkg) {
cli::format_inline("{.run [conflict_prefer(\"{name}\", \"{pkg}\")](conflicted::conflict_prefer(\"{name}\", \"{pkg}\"))}")
})
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Indentation seems off here. More importantly, no need to call format_inline() here, because later we pass this to cli_abort() which does the formatting (again). So it could be something like

sprintf("{.run [conflict_prefer(\"%s\", \"%s\")](conflicted::conflict_prefer(\"%s\", \"%s\"))}", name, pkg, name, pkg)

hadley and others added 2 commits January 9, 2023 17:46
Co-authored-by: Gábor Csárdi <csardi.gabor@gmail.com>
R/disambiguate.R Outdated
cli::cli_abort(c(
"{label_conflicted()} {.strong {name}} found in {length(pkgs)} packages.",
"Declare a preference with `conflict_prefer()`:",
"Declare a preference with {.code conflict_prefer()}:",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we want to link to the help here? Or use {.fn conflict_prefer}?

R/disambiguate.R Outdated
"Either pick the one you want with {.code ::}:",
namespace,
"Or declare a preference with `conflict_prefer()`:",
"Or declare a preference with {.code conflict_prefer}:",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
"Or declare a preference with {.code conflict_prefer}:",
"Or declare a preference with {.fn conflict_prefer}:",

@gaborcsardi
Copy link
Member

Looks good!

@hadley hadley merged commit 76a1bb0 into main Jan 10, 2023
@hadley hadley deleted the cli branch January 10, 2023 14:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants