diff --git a/lib/optimist.rb b/lib/optimist.rb index cb3b990..07a11a4 100644 --- a/lib/optimist.rb +++ b/lib/optimist.rb @@ -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") && @@ -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