Sha256: d452800d6df2f30b90b4e1e26a1d178412c80bfca05ab442cee0d774f52a8427

Contents?: true

Size: 564 Bytes

Versions: 13

Compression:

Stored size: 564 Bytes

Contents

module Jack
  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

13 entries across 13 versions & 1 rubygems

Version Path
jack-eb-1.4.4 lib/jack/command.rb
jack-eb-1.4.3 lib/jack/command.rb
jack-eb-1.4.2 lib/jack/command.rb
jack-eb-1.4.1 lib/jack/command.rb
jack-eb-1.4.0 lib/jack/command.rb
jack-eb-1.3.0 lib/jack/command.rb
jack-eb-1.2.1 lib/jack/command.rb
jack-eb-1.2.0 lib/jack/command.rb
jack-eb-1.1.2 lib/jack/command.rb
jack-eb-1.1.1 lib/jack/command.rb
jack-eb-1.1.0 lib/jack/command.rb
jack-eb-1.0.1 lib/jack/command.rb
jack-eb-1.0.0 lib/jack/command.rb