Skip to content

Commit

Permalink
Add subcommand aliases to zsh completion
Browse files Browse the repository at this point in the history
Also sort the list alphabetically.
  • Loading branch information
lucc authored and scheibler committed Sep 2, 2016
1 parent adf6cfc commit 5c6442c
Showing 1 changed file with 17 additions and 17 deletions.
34 changes: 17 additions & 17 deletions misc/zsh/_khard
Original file line number Diff line number Diff line change
Expand Up @@ -47,21 +47,21 @@ case $state in
# Define an array with the subcommands and the description.
local -a subcommands_array
subcommands_array=(
'list:list all (selected) contacts'
'details:show details for a contact'
'export:export a contact'
'birthdays:list birthdays'
'email:list email addresses'
'phone:list phone numbers'
'source:edit the source vcard of a contact'
'new:add a new contact'
'add-email:add email address from email header to a contact'
'merge:merge two contacts'
'modify:edit a contact'
'copy:copy a contact to another addressbook'
'move:move a contact to another addressbook'
'remove:delete a contact'
'addressbooks:list available addressbooks'
add-email:'add email address from email header to a contact'
{addressbooks,abooks}:'list available addressbooks'
{birthdays,bdays}:'list birthdays'
{copy,cp}:'copy a contact to another addressbook'
{details,show}:'show details for a contact'
email:'list email addresses'
export:'export a contact'
{list,ls}:'list all (selected) contacts'
merge:'merge two contacts'
{modify,edit,ed}:'edit a contact'
{move,mv}:'move a contact to another addressbook'
{new,add}:'add a new contact'
phone:'list phone numbers'
{remove,rm,del,delete}:'delete a contact'
{source,src}:'edit the source vcard of a contact'
)
# Use this array to complete the subcommands.
_describe -t subcommands 'khard subcommands' subcommands_array && ret=0
Expand Down Expand Up @@ -125,7 +125,7 @@ case $state in
case $words[1] in
addressbooks|abooks)
options+=();;
list|ls|details|source|remove|delete|del|rm)
list|ls|details|show|source|src|remove|delete|del|rm)
options+=(
$default_addressbook_options $default_search_options $sort_options
);;
Expand Down Expand Up @@ -166,7 +166,7 @@ case $state in
options+=(
$copy_move_addressbook_options $default_search_options $sort_options
);;
modify|edit)
modify|edit|ed)
options+=(
$default_addressbook_options $template_file_input_options $default_search_options $sort_options
);;
Expand Down

0 comments on commit 5c6442c

Please sign in to comment.