Function: eshell--split-switch

eshell--split-switch is a byte-compiled function defined in esh-opt.el.gz.

Signature

(eshell--split-switch SWITCH KIND)

Documentation

Split SWITCH into its option name and potential value, if any.

KIND should be the integer 0 if SWITCH is a short option, or 1 if it's a long option.

Source Code

;; Defined in /usr/src/emacs/lisp/eshell/esh-opt.el.gz
(defun eshell--split-switch (switch kind)
  "Split SWITCH into its option name and potential value, if any.
KIND should be the integer 0 if SWITCH is a short option, or 1 if it's
a long option."
  (if (eq kind 0)
      ;; Short option
      (cons (aref switch 0)
            (and (> (length switch) 1) (substring switch 1)))
    ;; Long option
    (save-match-data
      (string-match "\\([^=]*\\)\\(?:=\\(.*\\)\\)?" switch)
      (cons (match-string 1 switch) (match-string 2 switch)))))