Module: Browserctl::Commands::Pause

Extended by:
CliOutput
Defined in:
lib/browserctl/commands/pause.rb

Class Method Summary collapse

Methods included from CliOutput

print_result

Class Method Details

.run(client, args) ⇒ Object



10
11
12
13
14
15
16
17
18
19
# File 'lib/browserctl/commands/pause.rb', line 10

def self.run(client, args)
  name = args.shift or abort "usage: browserctl pause <page>"
  res = client.pause(name)
  if res[:error]
    warn "Error: #{res[:error]}"
    exit 1
  end
  puts "Page '#{name}' paused. Browser is live — interact freely."
  puts "When done: browserctl resume #{name}"
end