;ELC   
;;; Compiled
;;; in Emacs version 29.4
;;; with all optimizations.



(require 'esh-util)#@2747 Process NAME's MACRO-ARGS using a set of command line OPTIONS.
After doing so, stores settings in local symbols as declared by OPTIONS;
then evaluates BODY-FORMS -- assuming all was OK.

OPTIONS is a list, beginning with one or more elements of the form:
(SHORT LONG VALUE SYMBOL HELP-STRING)
Each of these elements represents a particular command-line switch.

SHORT is either nil, or a character that can be used as a switch -SHORT.
LONG is either nil, or a string that can be used as a switch --LONG.
At least one of SHORT and LONG must be non-nil.
VALUE is the value associated with the option.  It can be either:
  t   - the option needs a value to be specified after the switch;
  nil - the option is given the value t;
  anything else - specifies the actual value for the option.
SYMBOL is either nil, or the name of the Lisp symbol that will be bound
to VALUE.  A nil SYMBOL calls `eshell-show-usage', and so is appropriate
for a "--help" type option.
HELP-STRING is a documentation string for the option.

Any remaining elements of OPTIONS are :KEYWORD arguments.  Some take
arguments, some do not.  The recognized :KEYWORDS are:

:external STRING
  STRING is an external command to run if there are unknown switches.

:usage STRING
  STRING is the initial part of the command's documentation string.
  It appears before the options are listed.

:post-usage STRING
  STRING is an optional trailing part of the command's documentation string.
  It appears after the options, but before the final part of the
  documentation about the associated external command (if there is one).

:show-usage
  If present, then show the usage message if the command is called with no
  arguments.

:preserve-args
  If present, do not pass MACRO-ARGS through `flatten-tree'
and `eshell-stringify-list'.

:parse-leading-options-only
  If present, do not parse dash or switch arguments after the first
positional argument.  Instead, treat them as positional arguments themselves.

For example, OPTIONS might look like:

   ((?C  nil         nil multi-column    "multi-column display")
    (nil "help"      nil nil             "show this usage display")
    (?r  "reverse"   nil reverse-list    "reverse order while sorting")
    :external "ls"
    :usage "[OPTION]... [FILE]...
  List information about the FILEs (the current directory by default).
  Sort entries alphabetically across.")

`eshell-eval-using-options' returns the value of the last form in
BODY-FORMS.  If instead an external command is run (because of
an unknown option), the tag `eshell-external' will be thrown with
the new process for its value.

Lastly, any remaining arguments will be available in the locally
let-bound variable `args'.

(fn NAME MACRO-ARGS OPTIONS &rest BODY-FORMS)
(defalias 'eshell-eval-using-options '(macro . #[899 "\300\301\302A@>\203 \303D\202 \304\305DDD\306\307\301	\257D\310\311\312\313\314\315\nA@\"\"!\316\"BB\317BBB\207" [let* temp-args :preserve-args copy-tree eshell-stringify-list flatten-tree processed-args eshell--do-opts append delete-dups delq nil mapcar #[257 "\211<\205 \3008\205 \3008\301B\207" [3 ((pop processed-args))] 3 "\n\n(fn OPT)"] ((args processed-args)) (ignore args)] 14 (#$ . 105)]))
(put 'eshell-eval-using-options 'edebug-form-spec '(form form sexp body))#@147 Helper function for `eshell-eval-using-options'.
This code doesn't really need to be macro expanded everywhere.

(fn NAME OPTIONS ARGS ORIG-ARGS)
(defalias 'eshell--do-opts #[1028 "\300\301!\210\30224 \3032) G\304U\203  \305>\203  \306\"\202( \307#\262\3100\211\2051 \311\312\"\2620\211\203@ \313\314\315\"\"\207\207" [require esh-ext eshell-ext-command eshell-usage 0 :show-usage eshell-show-usage eshell--process-args nil error "%s" throw eshell-external eshell-external-command] 10 (#$ . 3402)])#@71 Display the usage message for NAME, using OPTIONS.

(fn NAME OPTIONS)
(defalias 'eshell-show-usage #[514 "\300\301!\210\302\303\304>A@#\305>\306>\307\203\201 @<\203z @\310\262\211@\203E \211A@\203E \302\311\302\312@A@#\3138#P\262\210\202z \211@\203] \302\311\302\314@\"\3138#P\262\210\202z \211A@\203w \302\311\302\315A@\"\3138#P\262\210\202z \307\266\202A\262\202 \203\221 \205\213 \316A@Q\262\203\250 \317A@!\262\203\250 \320\321\"P\262\322\323\"\207" [require esh-ext format "usage: %s %s\n\n" :usage :external :post-usage nil t "    %-20s %s\n" "-%c, --%s" 4 "-%c" "    --%s" "\n" eshell-search-path format-message "\nThis command is implemented in Lisp.  If an unrecognized option is\npassed to this command, the external version `%s'\nwill be called instead." throw eshell-usage] 14 (#$ . 3919)])#@168 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.

(fn SWITCH KIND)
(defalias 'eshell--split-switch #[514 "\211\300=\203 \300HG\301V\205 \301\302OB\207\303 \304\305\"\216\306\307\"\210\310\301\"\310\311\")B\207" [0 1 nil match-data make-closure #[0 "\301\300\302\"\207" [V0 set-match-data t] 3] string-match "\\([^=]*\\)\\(?:=\\(.*\\)\\)?" match-string 2] 7 (#$ . 4766)])#@449 Using NAME's remaining args (index AI), set the OPT within OPTIONS.
VALUE is the potential value of the OPT, coming from args like
"-fVALUE" or "--foo=VALUE", or nil if no value was supplied.  If
OPT doesn't consume a value, return VALUE unchanged so that it can be
processed later; otherwise, return nil.

If the OPT consumes an argument for its value and VALUE is nil, the
argument list will be modified.

(fn NAME AI OPT VALUE OPTIONS OPT-VALS)
(defalias 'eshell--set-option #[1542 "\3018\204\f \302\"\207\3038\304=\203M \3018\236\206I GV\203, \305\306\"\202I \233\211\307X\203= A\202F S\233A\241\210\262\242\241\210\310\207\3018\236\3038\206Y \304\241\210\207" [eshell--args 3 eshell-show-usage 2 t error "%s: missing option argument" 0 nil] 11 (#$ . 5252)])#@755 For NAME, process SWITCH (of type KIND), from args at index AI.
The SWITCH will be looked up in the set of OPTIONS.

SWITCH should be a string starting with the option to process,
possibly followed by its value, e.g. "u" or "uUSER".  KIND should
be the integer 0 if it's a short option, or 1 if it's a long option.

The SWITCH is then be matched against OPTIONS.  If KIND is 0 and the
SWITCH matches an option that doesn't take a value, return the
remaining characters in SWITCH to be processed later as further short
options.

If no matching handler is found, and an :external command is defined
(and available), it will be called; otherwise, an error will be
triggered to say that the switch is unrecognized.

(fn NAME SWITCH KIND AI OPTIONS OPT-VALS)
(defalias 'eshell--process-option #[1542 "\300\"\301\211\203R @<\203K @@8\232\203K \302\n@A\n\n&\262\211\203B \303=\203B \304\305@#\210\306\262\301\262\202 A\262\202 \203W \207\307>\211\203f \310A@!\262\211\203o \311\312\"\207\304\313@!\203| \314\202} \315\f@#\207" [eshell--split-switch nil eshell--set-option 1 error "%s: option --%s doesn't allow an argument" t :external eshell-search-path throw eshell-ext-command characterp "%s: unrecognized option -%c" "%s: unrecognized option --%s"] 17 (#$ . 6048)])#@63 Process the given ARGS using OPTIONS.

(fn NAME ARGS OPTIONS)
(defalias 'eshell--process-args #[771 "\301C\302\301\303\304\305\"\"\"\306\301\301GW\203\252 \211\203# \307>\204\252 8\262;\203; G\310V\203; \311\312\"\204E T\262\313\262\202 \314\310\"\314\315\"\233\306X\203] \211A\210\202f S\233A\241\266\203\214 \211G\306V\203\203 \316\n\310\f&\266\202 G\262\266\202 \211G\306V\203\245 \316\n\306\f&\262\202\214 \266\202 \303\317\"\244)\207" [eshell--args nil delq mapcar make-closure #[257 "\211<\205 \3018\211\205 \211\300\242>?\205 \300\300\242B\240\210\211C\262\207" [V0 3] 5 "\n\n(fn OPT)"] 0 :parse-leading-options-only 1 string-match "^-\\(-\\)?\\(.*\\)" t match-string 2 eshell--process-option cdr] 17 (#$ . 7358)])
(provide 'esh-opt)
