Skip to content

Commit

Permalink
Merge pull request #153 from nanobowers/fix_frozen_string
Browse files Browse the repository at this point in the history
fixes frozen string issue on old rb2.7, removed useless code
  • Loading branch information
Fryguy committed May 2, 2024
2 parents 3757b70 + ee5cda8 commit a02f7ec
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions lib/optimist.rb
Original file line number Diff line number Diff line change
Expand Up @@ -248,7 +248,6 @@ def educate_on_error

def handle_unknown_argument(arg, candidates, suggestions)
errstring = "unknown argument '#{arg}'"
errstring += " for command '#{subcommand_name}'" if self.respond_to?(:subcommand_name)
if (suggestions &&
Module::const_defined?("DidYouMean") &&
Module::const_defined?("DidYouMean::JaroWinkler") &&
Expand All @@ -275,7 +274,7 @@ def handle_unknown_argument(arg, candidates, suggestions)
end
unless corrections.empty?
dashdash_corrections = corrections.map{|s| "--#{s}" }
errstring << ". Did you mean: [#{dashdash_corrections.join(', ')}] ?"
errstring += ". Did you mean: [#{dashdash_corrections.join(', ')}] ?"
end
end
raise CommandlineError, errstring
Expand Down

0 comments on commit a02f7ec

Please sign in to comment.