Module: Caliph::CommandLineDSL

Included in:
CommandLineExampleGroup
Defined in:
lib/caliph/command-line-dsl.rb

Defined Under Namespace

Classes: Watcher

Instance Method Summary collapse

Instance Method Details

#cmd(*args) {|cmd| ... } ⇒ Object

Yields:



11
12
13
14
15
16
17
18
# File 'lib/caliph/command-line-dsl.rb', line 11

def cmd(*args, &block)
  watcher = Watcher.new
  cmd = CommandLine.new(*args)
  cmd.definition_watcher = watcher
  watcher.apex = cmd
  yield cmd if block_given?
  watcher.apex
end

#escaped_command(*args, &block) ⇒ Object



20
21
22
# File 'lib/caliph/command-line-dsl.rb', line 20

def escaped_command(*args, &block)
  ShellEscaped.new(CommandLine.new(*args, &block))
end