eshell--process-option

eshell--process-option is a compiled Lisp function in `esh-opt.el'.

(eshell--process-option NAME SWITCH KIND AI OPTIONS OPT-VALS)

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 either a string or character. KIND should be the
integer 0 if it's a character, or 1 if it's a string.

The SWITCH is then be matched against 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.