From f1ba900585afecfa13b7fff36968fca3e305c371 Mon Sep 17 00:00:00 2001 From: Nobuyoshi Nakada Date: Mon, 30 Oct 2023 16:35:43 +0900 Subject: [PATCH] Simply dump strings to escape --- lib/thor/parser/argument.rb | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/lib/thor/parser/argument.rb b/lib/thor/parser/argument.rb index 01820111..0cd1f7bf 100644 --- a/lib/thor/parser/argument.rb +++ b/lib/thor/parser/argument.rb @@ -26,10 +26,7 @@ def initialize(name, options = {}) def print_default if @type == :array and @default.is_a?(Array) - @default.map { |x| - p = x.gsub('"','\\"') - "\"#{p}\"" - }.join(" ") + @default.map(&:dump).join(" ") else @default end