Class: Browserctl::Commands::OpenPage
- Inherits:
-
Object
- Object
- Browserctl::Commands::OpenPage
- Extended by:
- CliOutput
- Defined in:
- lib/browserctl/commands/open_page.rb
Class Method Summary collapse
Methods included from CliOutput
Class Method Details
.run(client, args) ⇒ Object
11 12 13 14 15 16 17 18 |
# File 'lib/browserctl/commands/open_page.rb', line 11 def self.run(client, args) opts = Optimist.(args) do "Usage: browserctl open <page> [--url URL]" opt :url, "URL to navigate to", type: :string, short: "-u" end name = args.shift or abort "usage: browserctl open <page> [--url URL]" print_result(client.open_page(name, url: opts[:url])) end |