Skip to content

Commit fac5041

Browse files
committed
fix(CLI): escape subcommand descriptions
Otherwise, we could have had invalid rust strings. [skip ci]
1 parent bd27046 commit fac5041

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

src/mako/cli/lib/argparse.mako

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
if isinstance(v, bool):
1818
v = v and 'true' or 'false'
1919
elif isinstance(v, basestring):
20-
v = '"%s"' % v
20+
v = '"%s"' % v.replace('"', r'\"')
2121
elif isinstance(v, list):
2222
v = 'vec![%s]' % ','.join('UploadProtocol::%s' % p.capitalize() for p in v)
2323
return 'Some(%s)' % v

0 commit comments

Comments
 (0)