1
0
mirror of https://github.com/moparisthebest/pacman synced 2024-12-22 15:58:50 -05:00

zsh completion: use consistent case statement style

Signed-off-by: Daniel Wallace <danielwallace@gtmanfred.com>
Signed-off-by: Allan McRae <allan@archlinux.org>
This commit is contained in:
Daniel Wallace 2013-03-06 16:04:00 -05:00 committed by Allan McRae
parent 8db7e0c98d
commit 704ab17a6a

View File

@ -341,8 +341,18 @@ _pacman_zsh_comp() {
"$_pacman_opts_query_modifiers[@]" \
'*:package file:_files -g "*.pkg.tar*"'
;;
Q*) _pacman_action_query ;;
R*) _pacman_action_remove ;;
T*)
_arguments -s : \
'-T' \
"$_pacman_opts_common[@]" \
":packages:_pacman_all_packages"
;;
Q*)
_pacman_action_query
;;
R*)
_pacman_action_remove
;;
S*c*) # no completion
return 0
;;
@ -358,16 +368,24 @@ _pacman_zsh_comp() {
"$_pacman_opts_sync_modifiers[@]" \
'*:package group:_pacman_completions_all_groups'
;;
S*) _pacman_action_sync ;;
S*)
_pacman_action_sync
;;
T*)
_arguments -s : \
'-T' \
"$_pacman_opts_common[@]" \
":packages:_pacman_all_packages"
;;
U*) _pacman_action_upgrade ;;
V*) _pacman_action_version ;;
* ) _pacman_action_none ;;
U*)
_pacman_action_upgrade
;;
V*)
_pacman_action_version
;;
*)
_pacman_action_none
;;
esac
}
@ -441,7 +459,9 @@ _pacman_key() {
"$_key_shortopts[@]" \
"$_key_longopts[@]"
;;
*) return 1;;
*)
return 1
;;
esac
;;
esac
@ -536,7 +556,9 @@ _makepkg(){
_arguments -s \
"$_makepkg_longopts[@]"
;;
- )_makepkg_action_none ;;
- )
_makepkg_action_none
;;
*)
i=$#
while [[ $words[i] != -* ]] && [[ $words[$i] != "makepkg" ]];do
@ -552,8 +574,12 @@ _makepkg(){
_arguments -s \
"$_makepkg_longopts[@]"
;;
- )_makepkg_action_none ;;
* ) return 1 ;;
- )
_makepkg_action_none
;;
* )
return 1
;;
esac
;;
esac
@ -561,13 +587,17 @@ _makepkg(){
_pacman_comp() {
case "$service" in
makepkg)
_makepkg "$@";;
_makepkg "$@"
;;
pacman-key)
_pacman_key "$@";;
_pacman_key "$@"
;;
pacman)
_pacman_zsh_comp "$@";;
_pacman_zsh_comp "$@"
;;
*)
_message "Error";;
_message "Error"
;;
esac
}