Function: pcomplete/dnf

pcomplete/dnf is an autoloaded and byte-compiled function defined in pcmpl-rpm.el.gz.

Signature

(pcomplete/dnf)

Documentation

Completion for the dnf command.

Source Code

;; Defined in /usr/src/emacs/lisp/pcmpl-rpm.el.gz
;;;###autoload
(defun pcomplete/dnf ()
  "Completion for the `dnf' command."
  (let ((subcmds (pcomplete-from-help "dnf --help"
                                      :margin (rx bol (group (* " "))
                                                  (one-or-more (any "a-z" "-")) "  ")
                                      :argument (rx (not "-") (1+ (any "a-z" "-"))))))
    (while (not (member (pcomplete-arg 1) subcmds))
      (pcomplete-here (completion-table-merge
                       subcmds
                       (pcomplete-from-help "dnf --help"))))
    (let ((subcmd (pcomplete-arg 1)))
      (while (pcase subcmd
               ((guard (pcomplete-match "\\`-" 0))
                (if-let* (((pcomplete-match (rx bos "--what" (* (not "=")) "="
                                                (group (* anychar)) eos)
                                            0))
                          (stub (pcomplete-match-string 1 0)))
                    (pcomplete-here (pcmpl-rpm--dnf-packages "--available") stub)
                  (pcomplete-here
                   (pcomplete-from-help `("dnf" ,subcmd "--help")))))
               ((or "downgrade" "dg" "upgrade" "up" "update" "reinstall" "rei"
                    "remove" "rm")
                (pcomplete-here (pcmpl-rpm--dnf-packages "--installed")))
               ((or "builddep" "changelog" "info" "if" "install" "in" "list" "ls"
                    "mark" "repoquery" "rq" "advisory" "updateinfo")
                (pcomplete-here (pcmpl-rpm--dnf-packages "--available"))))))))