From ee5cda83c5a85c3255b5b65f132a252df8bd30ee Mon Sep 17 00:00:00 2001 From: Ben Bowers Date: Thu, 2 May 2024 08:08:03 -0400 Subject: [PATCH] fixes frozen string issue on old rb2.7, removed useless code --- lib/optimist.rb | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) 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