r-lib / cli

Tools for making beautiful & useful command line interfaces
https://cli.r-lib.org/
Other
644 stars 70 forks source link

Add advice for text + line + col + file hyperlink #670

Open olivroy opened 7 months ago

olivroy commented 7 months ago

Until https://github.com/r-lib/cli/issues/601 is fixed.

I tried looking into fixing it, but couldn't figure it out due to the regexp.

I added this clarification about line and col being numeric, because I was once extracting regexp and forgot to convert to numeric, and they get ignored.

# silently fails
cli::style_hyperlink(
  text = "R profile at line 5",
  url = "file://~/.Rprofile",
  params = list(line = "5", col = "1")
)