Class: Browserctl::Commands::Fill
- Inherits:
-
Object
- Object
- Browserctl::Commands::Fill
- Extended by:
- CliOutput
- Defined in:
- lib/browserctl/commands/fill.rb
Class Method Summary collapse
Methods included from CliOutput
Class Method Details
.run(client, args) ⇒ Object
11 12 13 14 15 16 17 18 19 20 |
# File 'lib/browserctl/commands/fill.rb', line 11 def self.run(client, args) opts = Optimist.(args) do "Usage: browserctl fill <page> <selector> <value>\n " \ "browserctl fill <page> --ref <ref> --value <value>" opt :ref, "Snapshot ref to fill", type: :string, short: "-r" opt :value, "Value to fill", type: :string, short: "-V" end name = args.shift opts[:ref] ? fill_by_ref(client, name, opts) : fill_by_selector(client, name, args, opts[:value]) end |