From cf8905b2b0dc4d3c4a58013450669edcb4995b43 Mon Sep 17 00:00:00 2001 From: James Cammarata Date: Mon, 21 Jul 2014 20:40:58 -0500 Subject: [PATCH] Fixing up shell quoting issues --- commands/command | 29 +++++++++++++++++++++-------- 1 file changed, 21 insertions(+), 8 deletions(-) diff --git a/commands/command b/commands/command index f61bd1f7dcc..69e8362bc7f 100644 --- a/commands/command +++ b/commands/command @@ -92,6 +92,24 @@ EXAMPLES = ''' creates: /path/to/database ''' +# This is a pretty complex regex, which functions as follows: +# +# 1. (^|\s) +# ^ look for a space or the beginning of the line +# 2. (creates|removes|chdir|executable|NO_LOG)= +# ^ look for a valid param, followed by an '=' +# 3. (?P[\'"])? +# ^ look for an optional quote character, which can either be +# a single or double quote character, and store it for later +# 4. (.*?) +# ^ match everything in a non-greedy manner until... +# 5. (?(quote)(?[\'"])?(.*?)(?(quote)(?