From fac50418a7156b1b2fa958008691dbb2f6cbb756 Mon Sep 17 00:00:00 2001 From: Sebastian Thiel Date: Thu, 30 Apr 2015 13:47:59 +0200 Subject: [PATCH] fix(CLI): escape subcommand descriptions Otherwise, we could have had invalid rust strings. [skip ci] --- src/mako/cli/lib/argparse.mako | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/mako/cli/lib/argparse.mako b/src/mako/cli/lib/argparse.mako index b29ba8736b..8d0aebe2ec 100644 --- a/src/mako/cli/lib/argparse.mako +++ b/src/mako/cli/lib/argparse.mako @@ -17,7 +17,7 @@ if isinstance(v, bool): v = v and 'true' or 'false' elif isinstance(v, basestring): - v = '"%s"' % v + v = '"%s"' % v.replace('"', r'\"') elif isinstance(v, list): v = 'vec![%s]' % ','.join('UploadProtocol::%s' % p.capitalize() for p in v) return 'Some(%s)' % v