From 7b9f162e7d8bccee2eb47cecb4cf0430b9afef2d Mon Sep 17 00:00:00 2001 From: Maxime Coste Date: Sun, 22 Jul 2018 15:51:32 +1000 Subject: Opt-in types for quoting of option lists This avoid quoting ints in int-lists for example, as they do not risk containing whitespaces. Fixes #2223 --- src/string_utils.hh | 1 + 1 file changed, 1 insertion(+) (limited to 'src/string_utils.hh') diff --git a/src/string_utils.hh b/src/string_utils.hh index 558ba62f..0a6c2594 100644 --- a/src/string_utils.hh +++ b/src/string_utils.hh @@ -68,6 +68,7 @@ Optional str_to_int_ifp(StringView str); inline String option_to_string(StringView opt) { return opt.str(); } inline String option_from_string(Meta::Type, StringView str) { return str.str(); } inline bool option_add(String& opt, StringView val) { opt += val; return not val.empty(); } +constexpr bool option_needs_quoting(Meta::Type) { return true; } template struct InplaceString -- cgit v1.2.3