class Thor::Argument
def initialize(name, options = {})
def initialize(name, options = {}) class_name = self.class.name.split('::').last type = options[:type] fail ArgumentError, "#{class_name} name can't be nil." if name.nil? fail ArgumentError, "Type :#{type} is not valid for #{class_name.downcase}s." if type && !valid_type?(type) @name = name.to_s @description = options[:desc] @required = options.key?(:required) ? options[:required] : true @type = (type || :string).to_sym @default = options[:default] @banner = options[:banner] || default_banner @enum = options[:enum] validate! # Trigger specific validations end