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
15
# File 'lib/browserctl/commands/snapshot.rb', line 9

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