Stefan Kangas writes: >> +;;;###autoload >> +(defun pcomplete/doas () >> + "Completion for the `doas' command." >> + (pcomplete-opt "su") > > Are there any other options that are worth adding? > > https://man.openbsd.org/doas > The options "su" are the flags shared across BSD, Linux, and eshell-builtin versions of doas. The revised patch (attached) has all flags from the BSD version, but will provide completions for invalid flags for Linux and eshell doas. BSD and Linux doas doesn't have a -h/--help flag, so I don't think we can get the flags using pcomplete-from-help unfortunately.