summaryrefslogtreecommitdiff
path: root/cli/parser.cxx
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2009-10-04 11:38:44 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2009-10-04 11:38:44 +0200
commit6caffa6a23befba0d7a7e4f39e08928ba317866a (patch)
treef9cbcd6c9226dee050e67e7dbd23ae4f830725aa /cli/parser.cxx
parentcfb91e263c22f6f81ae05a2027a2befac6d41e06 (diff)
Add support for option name aliases and string literals
Diffstat (limited to 'cli/parser.cxx')
-rw-r--r--cli/parser.cxx15
1 files changed, 14 insertions, 1 deletions
diff --git a/cli/parser.cxx b/cli/parser.cxx
index 54ab78a..55c609a 100644
--- a/cli/parser.cxx
+++ b/cli/parser.cxx
@@ -405,7 +405,20 @@ option_def (token& t)
case token::t_string_lit:
{
if (valid_)
- nl.push_back (t.literal ());
+ {
+ // Get rid of '"'.
+ //
+ string r;
+ string const& l (t.literal ());
+
+ for (size_t i (0), n (l.size ()); i < n; ++i)
+ {
+ if (l[i] != '"' || (i != 0 && l[i - 1] == '\\'))
+ r += l[i];
+ }
+
+ nl.push_back (r);
+ }
break;
}