Module: Caliph::CommandLineDSL

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

Instance Method Summary collapse

Instance Method Details

#cmd(*args, &block) ⇒ Object



4
5
6
7
8
9
10
# File 'lib/caliph/command-line-dsl.rb', line 4

def cmd(*args, &block)
  cmd = CommandLine.new(*args)
  if block_given?
    cmd = Describer.new(cmd).describe(&block)
  end
  return cmd
end

#escaped_command(*args, &block) ⇒ Object



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

def escaped_command(*args, &block)
  command = nil
  if args.length == 1 and args.first.is_a? CommandLine
    command = args.first
  else
    command = cmd(*args, &block)
  end
  ShellEscaped.new(command)
end