Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
[PATCH] Updated _aptitude zsh completion to cope with changed --help/-h output of aptitude 0.7.5
- X-seq: zsh-workers 37438
- From: Axel Beckert <abe@xxxxxxxxxxxxxxx>
- To: zsh-workers@xxxxxxx
- 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
- Cc: 807906@xxxxxxxxxxxxxxx, Aptitude Development Team <aptitude-devel@xxxxxxxxxxxxxxxxxxxxxxx>
- Face: iVBORw0KGgoAAAANSUhEUgAAADAAAAAwBAAAAAC3mUtaAAAABGdBTUEAALGPC/xhBQAAADh0RVh0U29mdHdhcmUAWFYgVmVyc2lvbiAzLjEwYSAgUmV2OiAxMi8yOS85NCAoUE5HIHBhdGNoIDEuMindFS5JAAACGElEQVQ4jXXQMU8UYRDG8f8shNjdDH4AbpfGDjAWlKiJiZ0ajL1aGCvsNCbGaCGG1koLaztaTYz6ATy+gOyehYmF3MxVxgg3FnDsHcTpJr/M+8w7Rf6nCsaVTTDqxbg9hoOXmw83H71+Eyfg4E1d7/Z2fG9rGkZbTQiu+K+3U/C+76lmkvAhJuDndnoAiftou4V84okAGclop4U/jYACZDTxrYWP0gkxVfAm/W//GLZpxIzwIN0Hn8dw0B+IWkZmQmRsj2HfhwokEklHfNCCiQCRgAR7YyhQVRVTCKCzP4Y5zBBE0t0zY3Q8oQaBqqAMlVEcgVQd9706zGirAFium8HXumlMIeMwqQCInju+2+uB6MRENupdpMt8pRlHZyuAW0F+Mb6XSIVqtxjD+iVmVqqystLEzFTGT92YqRaXpNT5eTVjeJhbALPnrTxLUZUKZsgxcNm64hAOYisT/xhF+oKTGU5RegtC3Rt6eEDi/QnIevdTx9Md2EMmYBRmCQR1026FCGQQJJExsRUqgkMGaWSbwYLnoO4T6VgpbQbdELPMBAHWWrhYrcxXnYgAsatPWygkFCBD4K62MAsOTqA6szYRPpsu6e6Y8mPiVrBMNuGIMrgwBUu4p2DgG1Ownu6hpuTv7hScefHAzAC/yRRw5U5pALMbJ4AUALvHSZhxgHPXTsHcdWD1GadAHr9avP+c0wCr7263Df8ASLwXWHWs+KIAAAAHdElNRQfYBQEBODPr
- List-help: <mailto:zsh-workers-help@zsh.org>
- List-id: Zsh Workers List <zsh-workers.zsh.org>
- List-post: <mailto:zsh-workers@zsh.org>
- Mail-followup-to: zsh-workers@xxxxxxx, 807906@xxxxxxxxxxxxxxx, Aptitude Development Team <aptitude-devel@xxxxxxxxxxxxxxxxxxxxxxx>
- Mailing-list: contact zsh-workers-help@xxxxxxx; run by ezmlm
- Organization: DeuxChevaux.org -- The Citroën 2CV Database
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@xxxxxxxxxxxxxxx (Mail)
X See http://www.nonhtmlmail.org/campaign.html | abe@xxxxxxxxx (Mail+Jabber)
/ \ I love long mails: http://email.is-not-s.ms/ | http://abe.noone.org/ (Web)
Messages sorted by:
Reverse Date,
Date,
Thread,
Author