Hey there 👋
I wrote a bash completion script for pacreport. Please feel free to add it to the repo.
BTW: In the process I noticed two minor issues with the docs:
- The man pages erroneously document the
--cachedir option as --cache-dir.
--optional-deps is only documented in the man pages, but omitted from the --help output.
# This file is in the public domain.
_pacreport() {
local cur prev words cword
_init_completion || return
local opts='--config --dbext --dbpath --root --sysroot --cachedir --backups --group --missing-files --unowned-files --optional-deps --help --version'
case "${prev}" in
# requires file argument
--config)
_filedir
return 0
;;
# requires directory argument
--root|--sysroot|--cachedir|--dbpath)
_filedir -d
return 0
;;
# requires group argument
--group)
COMPREPLY=( $(compgen -W "$(pacman -Sgq)" -- ${cur}) )
return 0
;;
# requires some argument
--dbext)
return 0
;;
*)
COMPREPLY=( $(compgen -W "${opts}" -- ${cur}) )
;;
esac
}
complete -F _pacreport pacreport
# vim: et:ts=2:sw=2:ft=bash
Hey there 👋
I wrote a bash completion script for
pacreport. Please feel free to add it to the repo.BTW: In the process I noticed two minor issues with the docs:
--cachediroption as--cache-dir.--optional-depsis only documented in the man pages, but omitted from the--helpoutput.