Class: LonoCfn::Command

Inherits:
Thor
  • Object
show all
Defined in:
lib/lono-cfn/command.rb

Direct Known Subclasses

CLI

Class Method Summary collapse

Class Method Details

.dispatch(m, args, options, config) ⇒ Object



4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
# File 'lib/lono-cfn/command.rb', line 4

def dispatch(m, args, options, config)
  # Allow calling for help via:
  #   ufo docker help
  #   ufo docker -h
  #   ufo docker --help
  #   ufo docker -D
  #
  # as well thor's nomral setting as
  #
  #   ufo help docker
  help_flags = Thor::HELP_MAPPINGS + ["help"]
  if args.length > 1 && !(args & help_flags).empty?
    args -= help_flags
    args.insert(-2, "help")
  end
  super
end