Method: CLI::UI.link
- Defined in:
- lib/cli/ui.rb
.link(url, text, format: true, blue_underline: format) ⇒ Object
Create a terminal link : (String url, String text, ?format: bool, ?blue_underline: bool) -> String
343 344 345 346 347 348 349 |
# File 'lib/cli/ui.rb', line 343 def link(url, text, format: true, blue_underline: format) raise 'cannot use blue_underline without format' if blue_underline && !format text = "{{blue:{{underline:#{text}}}}}" if blue_underline text = CLI::UI.fmt(text) if format "\x1b]8;;#{url}\x1b\\#{text}\x1b]8;;\x1b\\" end |