Class: Browserctl::Commands::Snapshot

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

Class Method Summary collapse

Class Method Details

.run(client, args) ⇒ Object



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

def self.run(client, args)
  name   = args.shift or abort "usage: browserctl snapshot <page> [--format ai|html]"
  format = FlagExtractor.extract_opt(args, "--format") || "ai"
  res    = client.snapshot(name, format: format)
  output_snapshot(res, format)
end