Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
PATCH: also handle yumdb from yum completion
- X-seq: zsh-workers 42549
- From: Oliver Kiddle <okiddle@xxxxxxxxxxx>
- To: Zsh workers <zsh-workers@xxxxxxx>
- Subject: PATCH: also handle yumdb from yum completion
- Date: Tue, 27 Mar 2018 23:39:50 +0200
- Authentication-results: amavisd4.gkg.net (amavisd-new); dkim=pass (2048-bit key) header.d=yahoo.co.uk
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.co.uk; s=s2048; t=1522198866; bh=RntGrqq+RXGseWtbVEpiyWsbfKbuM2AoQveM0D9/UtI=; h=From:To:Subject:Date:From:Subject; b=gDC8UEp41DniLYQ//Ar/JuMSZR++f47RWjklGSmxJcDAPxiFHkYgIASLG2hhEdy7YwZCcqzMPQtpmRPBoRYrPlrz0R3lt78MNUxbrsB+f9c2IDU1DLc99pUBw/tWQmYSXfel2xL2eRuiJD5m41COQ71QpZHgztYf3YcyXLB4mJEtEYKr/h+1SgQB5Ohe6qrYxOz0ehH3pHUSXQaKgRbs5fFK4jgaR56R+vAWpKu4+rwK84DS7L0VAjVloEPkpxEFAseK0LRjzVJtKdMPx3GZzEf4sL4ssOoUCCqL6rr7XGjHaPq3J3KSjMcsvIQsQrRXqEtzYRKDWt25DayhSW7L2A==
- List-help: <mailto:zsh-workers-help@zsh.org>
- List-id: Zsh Workers List <zsh-workers.zsh.org>
- List-post: <mailto:zsh-workers@zsh.org>
- List-unsubscribe: <mailto:zsh-workers-unsubscribe@zsh.org>
- Mailing-list: contact zsh-workers-help@xxxxxxx; run by ezmlm
This updates the yum completion to also handle yumdb.
Oliver
diff --git a/Completion/Redhat/Command/_yum b/Completion/Redhat/Command/_yum
index 4698a3159..34a337109 100644
--- a/Completion/Redhat/Command/_yum
+++ b/Completion/Redhat/Command/_yum
@@ -1,9 +1,14 @@
-#compdef yum
+#compdef yum yumdb
# Main dispatcher
_yum() {
local curcontext="$curcontext" state lstate line
+ if [[ $service = yumdb ]]; then
+ _yumdb
+ return
+ fi
+
_arguments -s \
'(- *)'{-h,--help}'[show the help message]' \
'(-t --tolerant)'{-t,--tolerant}'[be tolerant of errors]' \
@@ -46,6 +51,53 @@ _yum() {
'*::yum command:_yum_command'
}
+_yumdb() {
+ local curcontext="$curcontext" desc ret=1
+ local -a state line
+
+ _arguments -C \
+ '(- 1)--version[display version information]' \
+ '(- 1)'{-h,--help}'[display help information]' \
+ '--noplugins[disable yum plugin support]' \
+ '(-c --config)'{-c,--config=}'[specify config file location]:Yum conf file:_files' \
+ '1:command:((
+ get\:get\ value\ of\ given\ key
+ set\:set\ value\ of\ given\ key
+ del\:delete\ given\ key
+ rename\:rename\ given\ key
+ rename-force\:rename\ given\ key,\ potentially\ removing\ new-key
+ copy\:copy\ given\ key
+ copy-force\:copy\ given\ key,\ potentially\ removing\ new-key
+ search\:search\ packages\ for\ given\ key
+ exist\:list\ packages\ that\ have\ given\ key
+ unset\:list\ packages\ that\ lack\ given\ key
+ info\:display\ data\ in\ the\ yumdb
+ sync\:add\ package\ data\ from\ repositories
+ sync-force\:replace\ package\ data\ from\ repositories
+ undeleted shell
+ ))' \
+ '*:: :->args' && ret=0
+
+ if [[ -n $state ]]; then
+ case $CURRENT:$words[1] in
+ 3:set|<3->:search)
+ case $words[2] in
+ reason) _wanted reasons expl reason compadd user dep ;;
+ *) _message -e values value ;;
+ esac
+ ;;
+ 3:(copy|rename)*) desc='new key';&
+ 2:(^(info|sync)))
+ _wanted -x keys expl "${desc:-key}" compadd \
+ checksum_data checksum_type command_line from_repo from_repo_revision \
+ from_repo_timestamp reason releasever installonly origin_url changed_by && ret=0
+ ;;
+ *) _yum_act_on_installed_pkgs && ret=0 ;;
+ esac
+ fi
+ return ret
+}
+
(( $+functions[_yum_command] )) || _yum_command()
{
local -a _yum_cmds
Messages sorted by:
Reverse Date,
Date,
Thread,
Author