Class: Browserctl::Commands::Screenshot

Inherits:
Object
  • Object
show all
Defined in:
lib/browserctl/commands/screenshot.rb

Class Method Summary collapse

Class Method Details

.run(client, args) ⇒ Object



8
9
10
11
12
13
# File 'lib/browserctl/commands/screenshot.rb', line 8

def self.run(client, args)
  name = args.shift or abort "usage: browserctl shot <page> [--out PATH] [--full]"
  path = FlagExtractor.extract_opt(args, "--out")
  full = args.delete("--full") ? true : false
  puts client.screenshot(name, path: path, full: full).to_json
end