Sha256: 6cd66c69ea7fb24d306ce9be7aca15506662fd7febbb997d594a68d6af363350

Contents?: true

Size: 563 Bytes

Versions: 12

Compression:

Stored size: 563 Bytes

Contents

module Ufo
  class Command < Thor
    class << self
      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
    end
  end
end

Version data entries

12 entries across 12 versions & 1 rubygems

Version Path
ufo-2.1.0 lib/ufo/command.rb
ufo-2.0.3 lib/ufo/command.rb
ufo-2.0.2 lib/ufo/command.rb
ufo-2.0.1 lib/ufo/command.rb
ufo-2.0.0 lib/ufo/command.rb
ufo-1.7.1 lib/ufo/command.rb
ufo-1.7.0 lib/ufo/command.rb
ufo-1.6.2 lib/ufo/command.rb
ufo-1.6.1 lib/ufo/command.rb
ufo-1.6.0 lib/ufo/command.rb
ufo-1.5.0 lib/ufo/command.rb
ufo-1.2.0 lib/ufo/command.rb