From: Axel Beckert <abe@deuxchevaux.org>
To: zsh-workers@zsh.org
Cc: 807906@bugs.debian.org,
Aptitude Development Team
<aptitude-devel@lists.alioth.debian.org>
Subject: [PATCH] Updated _aptitude zsh completion to cope with changed --help/-h output of aptitude 0.7.5
Date: Sun, 27 Dec 2015 15:31:29 +0100 [thread overview]
Message-ID: <20151227143128.GC10509@sym.noone.org> (raw)
Hi,
the format of aptitude's --help/-h output slightly changed with the
0.7.5 release which caused the completion of subcommands to stop
working in zsh. This has been originally reported in Debian as
https://bugs.debian.org/807906
I've applied the following patch to Debian's zsh package in git,
verified that it works there and will upload it to Debian Unstable as
well as push it to the zsh git repository at SF. The patch should make
zsh work with both, the old and the new output.
Index: zsh/Completion/Debian/Command/_aptitude
===================================================================
--- zsh.orig/Completion/Debian/Command/_aptitude 2015-09-08 23:39:06.026975805 +0200
+++ zsh/Completion/Debian/Command/_aptitude 2015-12-26 19:26:14.681265798 +0100
@@ -80,7 +80,7 @@
case $state in
cmds)
- cmds=( ${${(M)${(f)"$(LC_ALL=C _call_program commands aptitude -h 2>/dev/null)"}:#* - *}/(#b) (*[^ ]) #- (*)/$match[1]:$match[2]:l})
+ cmds=( ${${(M)${(f)"$(LC_ALL=C _call_program commands aptitude -h 2>/dev/null)"}:# [^- ][^ ]## *}/(#b) ([^ ]##) ##(- )#([^- ]*)/$match[1]:$match[3]:l})
_describe -t commands 'aptitude command' cmds && ret=0
;;
For reference, here's the relevant part of the old and new output:
Old output:
→ aptitude -h
aptitude 0.6.11
Usage: aptitude [-S fname] [-u|-i]
aptitude [options] <action> ...
Actions (if none is specified, aptitude will enter interactive mode):
install - Install/upgrade packages.
remove - Remove packages.
purge - Remove packages and their configuration files.
hold - Place packages on hold.
unhold - Cancel a hold command for a package.
markauto - Mark packages as having been automatically installed.
unmarkauto - Mark packages as having been manually installed.
forbid-version - Forbid aptitude from upgrading to a specific package version.
update - Download lists of new/upgradable packages.
safe-upgrade - Perform a safe upgrade.
full-upgrade - Perform an upgrade, possibly installing and removing packages.
build-dep - Install the build-dependencies of packages.
forget-new - Forget what packages are "new".
search - Search for a package by name and/or expression.
show - Display detailed information about a package.
versions - Displays the versions of specified packages.
clean - Erase downloaded package files.
autoclean - Erase old downloaded package files.
changelog - View a package's changelog.
download - Download the .deb file for a package.
reinstall - Download and (possibly) reinstall a currently installed package.
why - Show the manually installed packages that require a package, or
why one or more packages would require the given package.
why-not - Show the manually installed packages that lead to a conflict
with the given package, or why one or more packages would
lead to a conflict with the given package if installed.
Options:
-h This help text.
--no-gui Do not use the GTK GUI even if available.
[…]
New output:
→ aptitude -h
aptitude 0.7.5
Usage: aptitude [-S fname] [-u|-i]
aptitude [options] <action> ...
Actions (if none is specified, aptitude will enter interactive mode):
install Install/upgrade packages.
remove Remove packages.
purge Remove packages and their configuration files.
hold Place packages on hold.
unhold Cancel a hold command for a package.
markauto Mark packages as having been automatically installed.
unmarkauto Mark packages as having been manually installed.
forbid-version Forbid aptitude from upgrading to a specific package version.
update Download lists of new/upgradable packages.
safe-upgrade Perform a safe upgrade.
full-upgrade Perform an upgrade, possibly installing and removing packages.
build-dep Install the build-dependencies of packages.
forget-new Forget what packages are "new".
search Search for a package by name and/or expression.
show Display detailed information about a package.
versions Displays the versions of specified packages.
clean Erase downloaded package files.
autoclean Erase old downloaded package files.
changelog View a package's changelog.
download Download the .deb file for a package.
reinstall Reinstall a currently installed package.
why Explain why a particular package should be installed.
why-not Explain why a particular package cannot be installed.
add-user-tag Add user tag to packages/patterns.
remove-user-tag Remove user tag from packages/patterns.
Options:
-h This help text.
--no-gui Do not use the GTK GUI even if available.
[…]
Main difference: no more dash inbetween subcommand and description.
Kind regards, Axel
--
/~\ Plain Text Ribbon Campaign | Axel Beckert
\ / Say No to HTML in E-Mail and News | abe@deuxchevaux.org (Mail)
X See http://www.nonhtmlmail.org/campaign.html | abe@noone.org (Mail+Jabber)
/ \ I love long mails: http://email.is-not-s.ms/ | http://abe.noone.org/ (Web)
reply other threads:[~2015-12-27 14:31 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20151227143128.GC10509@sym.noone.org \
--to=abe@deuxchevaux.org \
--cc=807906@bugs.debian.org \
--cc=aptitude-devel@lists.alioth.debian.org \
--cc=zsh-workers@zsh.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://git.vuxu.org/mirror/zsh/
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).