Sha256: 2be52da10bb2226c9f1985ede83a3df4fee8f173d7945c0e2e085fd23dfff2cc

Contents?: true

Size: 601 Bytes

Versions: 3

Compression:

Stored size: 601 Bytes

Contents

require "thor"

module AwsRds
  class Command < Thor
    class << self
      def dispatch(m, args, options, config)
        # Allow calling for help via:
        #   aws_rds command help
        #   aws_rds command -h
        #   aws_rds command --help
        #   aws_rds command -D
        #
        # as well thor's normal way:
        #
        #   aws_rds help command
        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

3 entries across 3 versions & 1 rubygems

Version Path
aws-rds-0.1.2 lib/aws_rds/command.rb
aws-rds-0.1.1 lib/aws_rds/command.rb
aws-rds-0.1.0 lib/aws_rds/command.rb