emacs-elpa-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[elpa] externals/shell-command+ a2b3036: Skip environmental variables wh


From: ELPA Syncer
Subject: [elpa] externals/shell-command+ a2b3036: Skip environmental variables when parsing a command
Date: Mon, 4 Oct 2021 15:57:27 -0400 (EDT)

branch: externals/shell-command+
commit a2b30360a18500bc6f9fdeece80c1b7255fd7fec
Author: Philip Kaludercic <philipk@posteo.net>
Commit: Philip Kaludercic <philipk@posteo.net>

    Skip environmental variables when parsing a command
---
 shell-command+.el | 26 +++++++++++++++++---------
 1 file changed, 17 insertions(+), 9 deletions(-)

diff --git a/shell-command+.el b/shell-command+.el
index 0d2394e..53aa7dd 100644
--- a/shell-command+.el
+++ b/shell-command+.el
@@ -237,21 +237,29 @@ If EXPAND is non-nil, expand wildcards."
 
 (defconst shell-command+--command-regexp
   (rx bos
-      ;; ignore all preceding whitespace
+      ;; Ignore all preceding whitespace
       (* space)
-      ;; check for working directory string
+      ;; Check for working directory string
       (? (group (or (: ?. (not (any "/"))) ?/ ?~)
                 (* (not space)))
          (+ space))
-      ;; check for redirection indicator
+      ;; Check for redirection indicator
       (? (group (or ?< ?> ?| ?!)))
-      ;; allow whitespace after indicator
+      ;; Allow whitespace after indicator
       (* space)
-      ;; actual command (and command name)
-      (group (group (+ (not space)))
-             (*? space)
-             (*? not-newline))
-      ;; ignore all trailing whitespace
+      ;; Actual command
+      (group
+       ;; Skip environmental variables
+       (* (: (+ alnum) "=" (or (: ?\" (* (or (: ?\\ anychar) (not (any ?\\ 
?\")))) ?\")
+                               (: ?\'(* (or (: ?\\ anychar) (not (any ?\\ 
?\')))) ?\')
+                               (+ (not space))))
+          (+ space))
+       ;; Command name
+       (group (+ (not space)))
+       ;; Parse arguments
+       (*? space)
+       (*? not-newline))
+      ;; Ignore all trailing whitespace
       (* space)
       eos)
   "Regular expression to parse `shell-command+' input.")



reply via email to

[Prev in Thread] Current Thread [Next in Thread]