diff options
| author | Christopher Bock <christopher@bocki.com> | 2026-04-30 19:39:52 +0200 |
|---|---|---|
| committer | Oliver Kiddle <opk@zsh.org> | 2026-04-30 21:19:01 +0200 |
| commit | c26e702ff7b28b388c86ec7eb2f3d5c8304e2b85 (patch) | |
| tree | b3c548daedb590b806889c928cf043f6da6261a8 | |
| parent | unposted: nedit-client is also commonly used as as the name for nc (diff) | |
| download | zsh-c26e702ff7b28b388c86ec7eb2f3d5c8304e2b85.tar zsh-c26e702ff7b28b388c86ec7eb2f3d5c8304e2b85.tar.gz zsh-c26e702ff7b28b388c86ec7eb2f3d5c8304e2b85.tar.bz2 zsh-c26e702ff7b28b388c86ec7eb2f3d5c8304e2b85.tar.lz zsh-c26e702ff7b28b388c86ec7eb2f3d5c8304e2b85.tar.xz zsh-c26e702ff7b28b388c86ec7eb2f3d5c8304e2b85.tar.zst zsh-c26e702ff7b28b388c86ec7eb2f3d5c8304e2b85.zip | |
github #168: complete apt history commands
| -rw-r--r-- | ChangeLog | 3 | ||||
| -rw-r--r-- | Completion/Debian/Command/_apt | 10 |
2 files changed, 12 insertions, 1 deletions
@@ -1,5 +1,8 @@ 2026-04-30 Oliver Kiddle <opk@zsh.org> + * Christopher Bock: github #168: Completion/Debian/Command/_apt: + add apt history commands + * unposted: Completion/X/Command/_nedit: nedit-client is also commonly used as as the name for nc diff --git a/Completion/Debian/Command/_apt b/Completion/Debian/Command/_apt index 19c2dfc8c..ac3095a4d 100644 --- a/Completion/Debian/Command/_apt +++ b/Completion/Debian/Command/_apt @@ -468,7 +468,9 @@ _apt-cmd () { /$'full-upgrade\0'/ \| \ /$'dist-upgrade\0'/ \| \ /$'edit-sources\0'/ /$'[^\0]#\0'/ ': ::_apt_sources' \# \| \ - /"[]"/ ':argument-1::compadd "$expl_action[@]" list search showsrc show depends rdepends policy update install reinstall download source build-dep remove upgrade full-upgrade dist-upgrade edit-sources autoclean changelog autopurge autoremove purge why why-not' + /$'history-list\0'/ \| \ + /$'(history-(info|redo|undo|rollback))\0'/ /$'[^\0]#\0'/ ': ::_apt_history_ids' \# \| \ + /"[]"/ ':argument-1::compadd "$expl_action[@]" list search showsrc show depends rdepends policy update install reinstall download source build-dep remove upgrade full-upgrade dist-upgrade edit-sources autoclean changelog autopurge autoremove purge why why-not history-list history-info history-redo history-undo history-rollback' _apt-cmd () { local expl_action expl_packages subcmd @@ -793,4 +795,10 @@ _apt_snapshot_dates() { _wanted list expl 'wayback date (yyyymmdd[ThhmmssZ])' compadd -- $dates } +_apt_history_ids() { + local -a expl historyids + historyids=( ${${${(f)"$(_call_program history-ids apt history-list)"}:#ID*}%% *} ) + _wanted history-ids expl 'history id' compadd -o numeric,reverse -a historyids +} + _apt "$@" |
