Function: transient-arg-value

transient-arg-value is a byte-compiled function defined in transient.el.

Signature

(transient-arg-value ARG ARGS)

Documentation

Return the value of ARG as it appears in ARGS.

For a switch return a boolean. For an option return the value as a string, using the empty string for the empty value, or nil if the option does not appear in ARGS.

Append "=to ARG to indicate that it is an option.

Source Code

;; Defined in ~/.emacs.d/elpa/transient-20260414.1009/transient.el
;;;; Utilities

(defun transient-arg-value (arg args)
  "Return the value of ARG as it appears in ARGS.

For a switch return a boolean.  For an option return the value as
a string, using the empty string for the empty value, or nil if
the option does not appear in ARGS.

Append \"=\ to ARG to indicate that it is an option."
  (save-match-data
    (cond-let
      ((member arg args) t)
      ([_(string-suffix-p "=" arg)]
       [match (let ((case-fold-search nil)
                    (re (format "\\`%s\\(?:=\\(.+\\)\\)?\\'"
                                (substring arg 0 -1))))
                (cl-find-if (lambda (a)
                              (and (stringp a)
                                   (string-match re a)))
                            args))]
       (match-string 1 match)))))