From fa7041f1911ffc4ab8c3de96e06d4858ff634ddc Mon Sep 17 00:00:00 2001 From: zawz Date: Mon, 8 Jul 2019 06:27:17 +0200 Subject: [PATCH] Support for multi-line shell command --- README | 3 +++ src/stringTools.cpp | 16 ++++++++++++++++ 2 files changed, 19 insertions(+) diff --git a/README b/README index 247d40f..4aadc9c 100644 --- a/README +++ b/README @@ -127,3 +127,6 @@ x single value x Comments can be done with // note: // in value lines will not be ignored + +A shell command can be written on multiple lines by containing it between '' right after = + note: additional ' in command need to be escaped with \ diff --git a/src/stringTools.cpp b/src/stringTools.cpp index 9ade4c0..fffdf53 100644 --- a/src/stringTools.cpp +++ b/src/stringTools.cpp @@ -492,6 +492,22 @@ std::pair readValue(std::string const& in, unsigned int ret += '\"'; return std::make_pair(name, ret); } + else if(in[i]=='\'') + { + i++; + j++; + while(i