completion: Add documentation for how to extend the zsh completion.

pull/1016/head
Arvid Norlander 2022-07-28 17:44:00 +02:00
parent c7959dcdf4
commit 4166a0f5ac
No known key found for this signature in database
GPG Key ID: E824A8E5D8D29AA0
1 changed files with 14 additions and 0 deletions

View File

@ -1,5 +1,19 @@
#compdef aur
#
# AUR supports third party extension of subcommands. This completion does too:
#
# In order to define completion for an aur subcommand "aur-mycmd" you need to
# create a file _aur-mycmd:
# * The first line should be: #compdef aur-mycmd
# * The second line should be: #description Description of Mycmd goes here
#
# Then the normal completion function follows, using _arguments or whatever you
# prefer.
#
# This completion mechanism was taken from the _git completion bundled with zsh.
#
# Helper to list valid repo-add attributes
__aur_list_attributes() {
declare -a attrs