diff options
-rw-r--r-- | ChangeLog | 3 | ||||
-rw-r--r-- | Completion/Debian/Command/_apt | 33 |
2 files changed, 35 insertions, 1 deletions
diff --git a/ChangeLog b/ChangeLog index bcffc900c..a9088ed29 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,8 @@ 2014-04-06 Peter Stephenson <p.w.stephenson@ntlworld.com> + * Sebastian Ramacher: 32533: Completion/Debian/Command/_apt: add + completion for "apt-mark". + * Alessandro Ghedini: 32532: Completion/Debian/Command/_apt: support 'apt' command. diff --git a/Completion/Debian/Command/_apt b/Completion/Debian/Command/_apt index 6f0bded78..bf5343a94 100644 --- a/Completion/Debian/Command/_apt +++ b/Completion/Debian/Command/_apt @@ -1,4 +1,4 @@ -#compdef apt apt-get apt-cache apt-cdrom apt-config +#compdef apt apt-get apt-cache apt-cdrom apt-config apt-mark _apt () { case "$service" in @@ -7,6 +7,7 @@ _apt () { apt-cache) _apt-cache "$@";; apt-cdrom) _apt-cdrom "$@";; apt-config) _apt-config "$@";; + apt-mark) _apt-mark "$@";; *) _message "unknown command $service";; esac } @@ -619,4 +620,34 @@ _apt_caching_policy () { /var/lib/dpkg/available -nt "$1" ]] } +_apt-mark () { + _apt_arguments _apt-mark_sm \ + -h,--help:bool \ + -v,--version:bool \ + -f,--file:configfile \ + -c,--config-file:configfile \ + -o,--option:arbitem \ + -qq:bool \ + -s:bool \ + -- \ + /$'auto\0'/ /$'[^\0]#\0'/ ':packages::_deb_packages "$expl_packages[@]" installed' \# \| \ + /$'manual\0'/ /$'[^\0]#\0'/ ':packages::_deb_packages "$expl_packages[@]" installed' \# \| \ + /$'hold\0'/ /$'[^\0]#\0'/ ':packages::_deb_packages "$expl_packages[@]" installed' \# \| \ + /$'unhold\0'/ /$'[^\0]#\0'/ ':packages::_deb_packages "$expl_packages[@]" installed' \# \| \ + /$'showauto\0'/ /$'[^\0]#\0'/ ':packages::_deb_packages "$expl_packages[@]" installed' \# \| \ + /$'showmanual\0'/ /$'[^\0]#\0'/ ':packages::_deb_packages "$expl_packages[@]" installed' \# \| \ + /$'showhold\0'/ /$'[^\0]#\0'/ ':packages::_deb_packages "$expl_packages[@]" installed' \# \| \ + /"[]"/ ':argument-1::compadd "$expl_action[@]" auto manual hold unhold showauto showmanual showhold' + + _apt-mark () { + local expl_action expl_packages + _description actions expl_action 'action' + _description packages expl_packages 'package' + + _apt-mark_sm + } + + _apt-mark "$@" +} + _apt "$@" |