Class: Browserctl::Commands::OpenPage

Inherits:
Object
  • Object
show all
Extended by:
CliOutput
Defined in:
lib/browserctl/commands/open_page.rb

Class Method Summary collapse

Methods included from CliOutput

print_result

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.options(args) do
    banner "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