-
Notifications
You must be signed in to change notification settings - Fork 17
Open
Description
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
--cachediroption as--cache-dir. --optional-depsis only documented in the man pages, but omitted from the--helpoutput.
# 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=bashReactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels