Skip to content

Instantly share code, notes, and snippets.

@snydergd
Last active January 6, 2016 02:35
Show Gist options
  • Save snydergd/3944a5d106ca68d64a29 to your computer and use it in GitHub Desktop.
Save snydergd/3944a5d106ca68d64a29 to your computer and use it in GitHub Desktop.
Bash completion for packagebuilder pb command
# bash completion for packagebuilder pb command
# (wrapper for pacman and aur on Arch Linux)
_pb() {
local word;
word=${COMP_WORDS[$COMP_CWORD]};
COMPREPLY=( $(pb -Ss "^${word}" 2>/dev/null | grep '^\S' | sed -e 's/^.*\/\(\S\+\)\s.*/\1/') );
return 0;
}
complete -F _pb pb
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment