From 069283e349b2e8dd324446aa5c30253a0993f1a3 Mon Sep 17 00:00:00 2001 From: mathieui Date: Mon, 28 Apr 2014 00:20:57 +0200 Subject: =?UTF-8?q?Don=E2=80=99t=20escape=20backslashes=20unless=20we=20ar?= =?UTF-8?q?e=20inside=20a=20quoted=20string=20and=20the=20next=20char=20is?= =?UTF-8?q?=20a=20quote?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sadly, we can’t doctest stuff with backslashes because it drives doctest crazy. --- src/common.py | 2 ++ 1 file changed, 2 insertions(+) (limited to 'src/common.py') diff --git a/src/common.py b/src/common.py index e9fe05c8..20700258 100644 --- a/src/common.py +++ b/src/common.py @@ -319,6 +319,8 @@ def shell_split(st): ['toto', 'titi'] >>> shell_split('toto ""') ['toto', ''] + >>> shell_split('to"to titi "a" b') + ['to"to', 'titi', 'a', 'b'] >>> shell_split('"toto titi" toto ""') ['toto titi', 'toto', ''] >>> shell_split('toto "titi') -- cgit v1.2.3