Jan-16-2018, 09:22 AM
(This post was last modified: Jan-16-2018, 09:23 AM by Gribouillis.)
(Jan-16-2018, 08:46 AM)CardBoy Wrote: To overcome this I amended the command to '--old-line-format='I hesitated to suggest this. Python has a function
shlex.split()
to split command lines. When I use it with the original command line it gives>>> s = '''diff --old-line-format="" --new-line-format="%5dn> %L" --unchanged-line-format="" /tmp/tmp923MGb/base.php /tmp/tmp923MGb/Test2.php''' >>> s 'diff --old-line-format="" --new-line-format="%5dn> %L" --unchanged-line-format="" /tmp/tmp923MGb/base.php /tmp/tmp923MGb/Test2.php' >>> import shlex >>> shlex.split(s) ['diff', '--old-line-format=', '--new-line-format=%5dn> %L', '--unchanged-line-format=', '/tmp/tmp923MGb/base.php', '/tmp/tmp923MGb/Test2.php']You see that the double quotes are also removed for the
--new-line-format
argument. This may be the correct way to get arguments for a given command line.