From a9e778fcc7f06a27f2d06da225f08110c9e2dca9 Mon Sep 17 00:00:00 2001 From: Maxime Coste Date: Sun, 23 Jun 2019 09:58:31 +1000 Subject: Add support for `echo -quoting (raw|kakoune|shell)` switch --- src/string_utils.hh | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'src/string_utils.hh') diff --git a/src/string_utils.hh b/src/string_utils.hh index 224dffc2..928070d3 100644 --- a/src/string_utils.hh +++ b/src/string_utils.hh @@ -2,6 +2,7 @@ #define string_utils_hh_INCLUDED #include "string.hh" +#include "enum.hh" #include "vector.hh" #include "optional.hh" @@ -143,6 +144,15 @@ enum class Quoting Shell }; +constexpr auto enum_desc(Meta::Type) +{ + return make_array, 3>({ + { Quoting::Raw, "raw" }, + { Quoting::Kakoune, "kakoune" }, + { Quoting::Shell, "shell" } + }); +} + inline auto quoter(Quoting quoting) { switch (quoting) -- cgit v1.2.3