Function: eshell--do-opts

eshell--do-opts is a byte-compiled function defined in esh-opt.el.gz.

Signature

(eshell--do-opts NAME ARGS ORIG-ARGS OPTIONS OPTION-SYMS)

Documentation

Helper function for eshell-eval-using-options.

This code doesn't really need to be macro expanded everywhere.

Source Code

;; Defined in /usr/src/emacs/lisp/eshell/esh-opt.el.gz
(defun eshell--do-opts (name args orig-args options option-syms)
  "Helper function for `eshell-eval-using-options'.
This code doesn't really need to be macro expanded everywhere."
  (require 'esh-ext)
  (declare-function eshell-external-command "esh-ext" (command args))
  (let ((ext-command
         (catch 'eshell-ext-command
           (let ((usage-msg
                  (catch 'eshell-usage
                    (if (and (= (length args) 0)
                             (memq ':show-usage options))
                        (eshell-show-usage name options)
                      (setq args (eshell--process-args name args options
                                                       option-syms))
                      nil))))
             (when usage-msg
               (user-error "%s" usage-msg))))))
    (if ext-command
        (throw 'eshell-external
               (eshell-external-command ext-command orig-args))
      args)))