zsh-workers
 help / color / mirror / code / Atom feed
* [PATCH] Add missing commands to Debian apt completion
@ 2016-11-22 18:31 Laurent Arnoud
  2016-11-25  9:35 ` Daniel Shahaf
  0 siblings, 1 reply; 5+ messages in thread
From: Laurent Arnoud @ 2016-11-22 18:31 UTC (permalink / raw)
  To: zsh-workers

Upstream ref
https://github.com/Debian/apt/commit/5aba18968d87500232244760101ab2954c106581

Cheers,
Laurent
---
 Completion/Debian/Command/_apt | 18 +++++++++++++++---
 1 file changed, 15 insertions(+), 3 deletions(-)

diff --git a/Completion/Debian/Command/_apt b/Completion/Debian/Command/_apt
index d92d2f8..dd05f5c 100644
--- a/Completion/Debian/Command/_apt
+++ b/Completion/Debian/Command/_apt
@@ -402,17 +402,29 @@ _apt-cmd () {
     /$'list\0'/ /$'[^\0]#\0'/ ':packages::_deb_packages "$expl_packages[@]" avail' \# \
     /$'search\0'/ /$'[^\0]#\0'/ ':strings:pattern:' \| \
     /$'show\0'/ /$'[^\0]#\0'/ ':packages::_deb_packages "$expl_packages[@]" avail' \# \
+    /$'showsrc\0'/ /$'[^\0]#\0'/ ':packages::_deb_packages "$expl_packages[@]" avail' \# \| \
+    /$'depends\0'/ /$'[^\0]#\0'/ ':packages::_deb_packages "$expl_packages[@]" avail' \# \| \
+    /$'rdepends\0'/ /$'[^\0]#\0'/ ':packages::_deb_packages "$expl_packages[@]" avail' \# \| \
+    /$'policy\0'/ /$'[^\0]#\0'/ ':packages::_deb_packages "$expl_packages[@]" avail' \# \| \
     /$'update\0'/ \| \
     \( \
-    /$'install\0'/ /$'[^\0]#\0'/ ':packages::_deb_packages "$expl_packages[@]" avail' \# \
-    /$'[^\0/]#/'/ /$'[^\0/]#\0'/ ':release name::_apt_releases' \) \| \
+    /$'install\0'\|$'download\0'\|$'source\0'\|$'build-dep\0'/ \
+      /$'[^\0]#\0'/ ':packages::_deb_packages "$expl_packages[@]" avail' \# \
+       \( \
+       /$'[^\0/]#/'/ /$'[^\0/]#\0'/ ':release name::_apt_releases' \| \
+       /$'[^\0=]#='/ /$'[^\0=]#\0'/ ':package version::_apt_versions_of_binary_package' \
+       \)  \
+    \) \| \
     /$'remove\0'/ /$'[^\0]#\0'/ ':packages::_deb_packages "$expl_packages[@]" installed' \# \| \
     /$'purge\0'/ /$'[^\0]#\0'/ ':packages::_deb_packages "$expl_packages[@]" installed' \# \| \
     /$'upgrade\0'/ \| \
+    /$'autoclean\0'/ \| \
+    /$'changelog\0'/ /$'[^\0]#\0'/ ':packages::_deb_packages "$expl_packages[@]" avail' \# \| \
     /$'autoremove\0'/ \| \
     /$'full-upgrade\0'/ \| \
+    /$'dist-upgrade\0'/ \| \
     /$'edit-sources\0'/ \| \
-    /"[]"/	':argument-1::compadd "$expl_action[@]" list search show update install remove upgrade full-upgrade edit-sources autoremove purge'
+    /"[]"/	':argument-1::compadd "$expl_action[@]" list search show showsrc depends rdepends policy update install download source build-dep remove upgrade full-upgrade dist-upgrade edit-sources autoclean changelog autoremove purge'
 
   _apt-cmd () {
     local expl_action expl_packages
-- 
2.10.2


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] Add missing commands to Debian apt completion
  2016-11-22 18:31 [PATCH] Add missing commands to Debian apt completion Laurent Arnoud
@ 2016-11-25  9:35 ` Daniel Shahaf
  2016-11-25 16:19   ` Laurent Arnoud
  2016-11-25 16:23   ` Laurent Arnoud
  0 siblings, 2 replies; 5+ messages in thread
From: Daniel Shahaf @ 2016-11-25  9:35 UTC (permalink / raw)
  To: Laurent Arnoud; +Cc: zsh-workers

Laurent Arnoud wrote on Tue, Nov 22, 2016 at 19:31:37 +0100:
> +++ b/Completion/Debian/Command/_apt
> @@ -402,17 +402,29 @@ _apt-cmd () {
>      /$'show\0'/ /$'[^\0]#\0'/ ':packages::_deb_packages "$expl_packages[@]" avail' \# \
> +    /$'showsrc\0'/ /$'[^\0]#\0'/ ':packages::_deb_packages "$expl_packages[@]" avail' \# \| \

I had to move the 'showsrc' line to above the 'show' line for «apt
showsrc <TAB>» to work.  Is this expected, or a bug in _apt_arguments
or _regex_arguments?

> +    /$'depends\0'/ /$'[^\0]#\0'/ ':packages::_deb_packages "$expl_packages[@]" avail' \# \| \
> +    /$'rdepends\0'/ /$'[^\0]#\0'/ ':packages::_deb_packages "$expl_packages[@]" avail' \# \| \
> +    /$'policy\0'/ /$'[^\0]#\0'/ ':packages::_deb_packages "$expl_packages[@]" avail' \# \| \

According to your reference, source|build-dep|showsrc|policy should
complete both binary package names and source package names.  It would
be nice to add support for the latter

Thanks for the patch.  Will commit once the show/showsrc issue is
clarified.

Cheers,

Daniel


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] Add missing commands to Debian apt completion
  2016-11-25  9:35 ` Daniel Shahaf
@ 2016-11-25 16:19   ` Laurent Arnoud
  2016-11-25 16:59     ` Daniel Shahaf
  2016-11-25 16:23   ` Laurent Arnoud
  1 sibling, 1 reply; 5+ messages in thread
From: Laurent Arnoud @ 2016-11-25 16:19 UTC (permalink / raw)
  To: Daniel Shahaf; +Cc: zsh-workers

Hi Daniel,

On Fri, Nov 25, 2016 at 09:35:51AM +0000, Daniel Shahaf wrote:
> Laurent Arnoud wrote on Tue, Nov 22, 2016 at 19:31:37 +0100:
> > +++ b/Completion/Debian/Command/_apt
> > @@ -402,17 +402,29 @@ _apt-cmd () {
> >      /$'show\0'/ /$'[^\0]#\0'/ ':packages::_deb_packages "$expl_packages[@]" avail' \# \
> > +    /$'showsrc\0'/ /$'[^\0]#\0'/ ':packages::_deb_packages "$expl_packages[@]" avail' \# \| \
> 
> I had to move the 'showsrc' line to above the 'show' line for «apt
> showsrc <TAB>» to work.  Is this expected, or a bug in _apt_arguments
> or _regex_arguments?

Yes you are right, I'm not sure about the bug but it is done like that in
`_apt-cache` function. I will just do as you did since I'm not an expert with
this.

Cheers,

-- 
Laurent


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] Add missing commands to Debian apt completion
  2016-11-25  9:35 ` Daniel Shahaf
  2016-11-25 16:19   ` Laurent Arnoud
@ 2016-11-25 16:23   ` Laurent Arnoud
  1 sibling, 0 replies; 5+ messages in thread
From: Laurent Arnoud @ 2016-11-25 16:23 UTC (permalink / raw)
  To: Daniel Shahaf; +Cc: zsh-workers

Upstream ref
https://github.com/Debian/apt/commit/5aba18968d87500232244760101ab2954c106581

Reviewed-by: Daniel Shahaf <d.s@daniel.shahaf.name>
---
 Completion/Debian/Command/_apt | 18 +++++++++++++++---
 1 file changed, 15 insertions(+), 3 deletions(-)

diff --git a/Completion/Debian/Command/_apt b/Completion/Debian/Command/_apt
index d92d2f8..4405de9 100644
--- a/Completion/Debian/Command/_apt
+++ b/Completion/Debian/Command/_apt
@@ -401,18 +401,30 @@ _apt-cmd () {
     -- \
     /$'list\0'/ /$'[^\0]#\0'/ ':packages::_deb_packages "$expl_packages[@]" avail' \# \
     /$'search\0'/ /$'[^\0]#\0'/ ':strings:pattern:' \| \
+    /$'showsrc\0'/ /$'[^\0]#\0'/ ':packages::_deb_packages "$expl_packages[@]" avail' \# \| \
     /$'show\0'/ /$'[^\0]#\0'/ ':packages::_deb_packages "$expl_packages[@]" avail' \# \
+    /$'depends\0'/ /$'[^\0]#\0'/ ':packages::_deb_packages "$expl_packages[@]" avail' \# \| \
+    /$'rdepends\0'/ /$'[^\0]#\0'/ ':packages::_deb_packages "$expl_packages[@]" avail' \# \| \
+    /$'policy\0'/ /$'[^\0]#\0'/ ':packages::_deb_packages "$expl_packages[@]" avail' \# \| \
     /$'update\0'/ \| \
     \( \
-    /$'install\0'/ /$'[^\0]#\0'/ ':packages::_deb_packages "$expl_packages[@]" avail' \# \
-    /$'[^\0/]#/'/ /$'[^\0/]#\0'/ ':release name::_apt_releases' \) \| \
+    /$'install\0'\|$'download\0'\|$'source\0'\|$'build-dep\0'/ \
+      /$'[^\0]#\0'/ ':packages::_deb_packages "$expl_packages[@]" avail' \# \
+       \( \
+       /$'[^\0/]#/'/ /$'[^\0/]#\0'/ ':release name::_apt_releases' \| \
+       /$'[^\0=]#='/ /$'[^\0=]#\0'/ ':package version::_apt_versions_of_binary_package' \
+       \)  \
+    \) \| \
     /$'remove\0'/ /$'[^\0]#\0'/ ':packages::_deb_packages "$expl_packages[@]" installed' \# \| \
     /$'purge\0'/ /$'[^\0]#\0'/ ':packages::_deb_packages "$expl_packages[@]" installed' \# \| \
     /$'upgrade\0'/ \| \
+    /$'autoclean\0'/ \| \
+    /$'changelog\0'/ /$'[^\0]#\0'/ ':packages::_deb_packages "$expl_packages[@]" avail' \# \| \
     /$'autoremove\0'/ \| \
     /$'full-upgrade\0'/ \| \
+    /$'dist-upgrade\0'/ \| \
     /$'edit-sources\0'/ \| \
-    /"[]"/	':argument-1::compadd "$expl_action[@]" list search show update install remove upgrade full-upgrade edit-sources autoremove purge'
+    /"[]"/	':argument-1::compadd "$expl_action[@]" list search showsrc show depends rdepends policy update install download source build-dep remove upgrade full-upgrade dist-upgrade edit-sources autoclean changelog autoremove purge'
 
   _apt-cmd () {
     local expl_action expl_packages
-- 
2.10.2


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] Add missing commands to Debian apt completion
  2016-11-25 16:19   ` Laurent Arnoud
@ 2016-11-25 16:59     ` Daniel Shahaf
  0 siblings, 0 replies; 5+ messages in thread
From: Daniel Shahaf @ 2016-11-25 16:59 UTC (permalink / raw)
  To: Laurent Arnoud; +Cc: zsh-workers

Laurent Arnoud wrote on Fri, Nov 25, 2016 at 17:19:05 +0100:
> On Fri, Nov 25, 2016 at 09:35:51AM +0000, Daniel Shahaf wrote:
> > Laurent Arnoud wrote on Tue, Nov 22, 2016 at 19:31:37 +0100:
> > > +++ b/Completion/Debian/Command/_apt
> > > @@ -402,17 +402,29 @@ _apt-cmd () {
> > >      /$'show\0'/ /$'[^\0]#\0'/ ':packages::_deb_packages "$expl_packages[@]" avail' \# \
> > > +    /$'showsrc\0'/ /$'[^\0]#\0'/ ':packages::_deb_packages "$expl_packages[@]" avail' \# \| \
> > 
> > I had to move the 'showsrc' line to above the 'show' line for «apt
> > showsrc <TAB>» to work.  Is this expected, or a bug in _apt_arguments
> > or _regex_arguments?
> 
> Yes you are right, I'm not sure about the bug but it is done like that in
> `_apt-cache` function. I will just do as you did since I'm not an expert with
> this.

Actually, I looked again and a «\|» is missing from the 'list' and
'show' lines.  I'll push your new patch with this modification.  Thanks
for the patch!


^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2016-11-25 17:01 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-11-22 18:31 [PATCH] Add missing commands to Debian apt completion Laurent Arnoud
2016-11-25  9:35 ` Daniel Shahaf
2016-11-25 16:19   ` Laurent Arnoud
2016-11-25 16:59     ` Daniel Shahaf
2016-11-25 16:23   ` Laurent Arnoud

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).