Skip to content

Commit

Permalink
Merge pull request #35 from atombender/fix_hash_collision_bug
Browse files Browse the repository at this point in the history
  • Loading branch information
parkr committed Jul 12, 2014
2 parents 4b3ce18 + cf008e6 commit cede013
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions lib/mercenary/command.rb
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ def default_command(command_name = nil)
def option(sym, *options)
new_option = Option.new(sym, options)
@options << new_option
@map[new_option.hash] = sym
@map[new_option] = sym
end

# Public: Adds a subcommand
Expand Down Expand Up @@ -178,7 +178,7 @@ def go(argv, opts, config)
def process_options(opts, config)
options.each do |option|
opts.on(*option.for_option_parser) do |x|
config[map[option.hash]] = x
config[map[option]] = x
end
end
end
Expand Down
2 changes: 1 addition & 1 deletion lib/mercenary/option.rb
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ def formatted_switches
def hash
instance_variables.map do |var|
instance_variable_get(var).hash
end.reduce(:&)
end.reduce(:^)
end

# Public: Check equivalence of two Options based on equivalence of their
Expand Down

0 comments on commit cede013

Please sign in to comment.