diff options
Diffstat (limited to 'Completion/Redhat')
-rw-r--r-- | Completion/Redhat/Command/_dnf | 4 | ||||
-rw-r--r-- | Completion/Redhat/Command/_rpm | 2 | ||||
-rw-r--r-- | Completion/Redhat/Command/_scl | 2 | ||||
-rw-r--r-- | Completion/Redhat/Command/_yum | 54 |
4 files changed, 57 insertions, 5 deletions
diff --git a/Completion/Redhat/Command/_dnf b/Completion/Redhat/Command/_dnf index 35b5aa27b..82b9b188f 100644 --- a/Completion/Redhat/Command/_dnf +++ b/Completion/Redhat/Command/_dnf @@ -38,9 +38,9 @@ _dnf_local_packages() { _dnf() { if [[ "$(readlink /usr/bin/dnf)" == "dnf-2" ]]; then - local python_exec="python2" + local python_exec="/usr/bin/python2" else - local python_exec="python3" + local python_exec="/usr/bin/python3" fi local helper=$(${python_exec} -c "import dnf.cli; print('{}/completion_helper.py'.format(dnf.cli.__path__[0]))") local cache_file="/var/cache/dnf/packages.db" diff --git a/Completion/Redhat/Command/_rpm b/Completion/Redhat/Command/_rpm index b24213e3c..a9306aa6c 100644 --- a/Completion/Redhat/Command/_rpm +++ b/Completion/Redhat/Command/_rpm @@ -45,7 +45,7 @@ _rpm () { local curcontext="$curcontext" state lstate line nm="$compstate[nmatches]" typeset -A opt_args local ret=1 - local -a tmp expl commonopts selectopts + local -a tmp expl commonopts selectopts pathopts commonopts=( '(-v --verbose)--quiet[print as little as possible]' diff --git a/Completion/Redhat/Command/_scl b/Completion/Redhat/Command/_scl index b7bba2b13..b9eaff11a 100644 --- a/Completion/Redhat/Command/_scl +++ b/Completion/Redhat/Command/_scl @@ -8,7 +8,7 @@ local -a state line force alts cmd _arguments -C $force \ '(- 1)'{-l,--list}'[list installed software collections or packages within a collection]' \ - '(-l --list)1:action:(enable run load unload list-collections list-packages man register deregister)' \ + '(-l --list)1:action:(enable run load unload list-collections list-enabled list-packages man register deregister)' \ '(- *)--help' \ '(-)*:collections:->collections' && ret=0 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 |