Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
no tab completion with equo
- X-seq: zsh-users 19087
- From: Clemens Schüller <cs.mlists+zsh-users@xxxxxxxxxxx>
- To: zsh users <zsh-users@xxxxxxx>
- Subject: no tab completion with equo
- Date: Mon, 15 Sep 2014 20:13:38 +0200
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/simple; d=mailbox.org; h= content-transfer-encoding:content-type:content-type:mime-version :user-agent:message-id:date:date:reply-to:subject:subject:from :from:received; s=mail20140220; t=1410804818; bh=vaBHySU69zTad4q XpfJrunbzVDtZ5qJm37EEJ0FeLJo=; b=i0LK45ei20C/+8GL36zaylVJUMXU8/G 5fs14qskXaM5B2WIsQMzny+coBLRPBo199Vt7nHWs7cOT2JQVd4RH7v5kCpEKFIz cQ8kgf4GJ2D+g9zDCVDmOZu5G/IqvJ+AaOVVr1fhYxkeB8HoHr7aUqdF/EOcl2mZ BMjGh7nDzW07j9hF3mm9LBcDtxY8qYLj7SEBM8RTplgU+6PnGKv+JEUSXRVb/B5t 2rpuEgEBrdBruRzilJV3wGk7XW5LRoivhy/O++QRp0JZe1lxXhlzScRw88jzJ/4t DXUl3ZWUcubhm2XrKLnkl8Ho66kKZOsbSPExKWRBMG2dmaEQmUMvcWrCS1iUCuPk abyY0+KJqoCVIf+PVTSb8LxHLfqKFmErnq3MXU1i1IvX5blXXRyic8XY0UiH9Ajm 0sHtttZq/mupXnnrm/R5gvtdiJhZAkmkLmvVxAs+azMRPoT6AIotln4DpBxArfIq GmrvOKaO5OYmzCcAJTrLzYQzHnDHbkKfNOiuJ51IfycdSPgxOsY04sz6IWo2aX4V sgOm7LvX31GJth6RC6kDCakL8qC8qetvTu0IajvXRbM4NMmwzrr3m2pmCj2xmvO2 1etVNB9LNRiy0uADwK249nldwaR1+UuaZB3Qpiavo+7RlLZ3XOOJ7d3R7aCBOvAn 7KDARB4ueFlc=
- List-help: <mailto:zsh-users-help@zsh.org>
- List-id: Zsh Users List <zsh-users.zsh.org>
- List-post: <mailto:zsh-users@zsh.org>
- Mailing-list: contact zsh-users-help@xxxxxxx; run by ezmlm
- Reply-to: Clemens Schüller <cs.mlists@xxxxxxxxxxx>
Hello!
equo is the frontend to the package manager of sabayon linux:
In the equo package is a tab completion file for the zsh. But zsh won't
work with the completion.
--8<---------------cut here---------------start------------->8---
[mente@cougar: ~]% equo [TAB]
No matches for: `command' or `equo command'
--8<---------------cut here---------------end--------------->8---
--8<---------------cut here---------------start------------->8---
[mente@cougar: ~]% dir /usr/share/zsh/site-functions/_equo
-rw-r--r-- 1 root root 2636 29. Jun 16:35 /usr/share/zsh/site-functions/_equo
--8<---------------cut here---------------start------------->8---
--8<---------------cut here---------------start------------->8---
[mente@cougar: ~]% cat /usr/share/zsh/site-functions/_equo
#compdef equo
local curcontext="$curcontext" state line cmds packages mirrors
typeset -A opt_args
_equo_get_mirrors()
{
mirrors=( ${(f)"$(equo status | grep Repository\ name | cut -d: -f2 | sed 's/^\ *//')"} )
_describe -t packages 'mirrors' mirrors
}
_equo_get_cmds()
{
cmds=( ${(f)"$(equo $1 --help | tr "\t" ":" | grep "^:[^:]" | sed 's/^:\([^:\ ]*\)[^:]*:*/\1:/')"} )
_describe -t commands 'command params' cmds
}
_equo_get_installed_packages()
{
packages=( ${(f)"$(equo query list installed | equo query list installed | sed 's/.*\///')"} )
_describe -t packages 'installed packages' packages
}
_equo_get_available_packages()
{
packages=( ${(f)"$(equo search $1 | grep Package |sed 's/.*\/\([^\ ]*\).*/\1/')"} )
_describe -t packages 'available packages' packages
}
_arguments -C \
"--help[print help]" \
"--version[print version]" \
"--nocolor[dont use colors]" \
"--color[use colors(default)]" \
"--bashcomp[print bash completion script]"\
'1:command:->cmds' \
'*:subcommand:->args'
case $state in
cmds)
cmds=( ${(f)"$(equo --help |tr "\t" ":" | grep "^:[^:-]" | sed 's/^:\(\w*\).*:\+/\1:/')"} )
_describe -t commands 'equo command' cmds
;;
args)
case $line[1] in
remove|config)
_equo_get_cmds $line[1] && return 0
_equo_get_installed_packages
;;
install|fetch|search|source|mask|unmask)
_equo_get_cmds $line[1] && return 0
_equo_get_available_packages $line[-1]
;;
repo)
case $line[2] in
enable|disable|remove|mirrorsort)
_equo_get_mirrors
;;
add|merge)
;;
*)
_equo_get_cmds $line[1]
;;
esac
;;
query)
case $line[2] in
changelog|revdeps|files|needed|removal|graph|revgraph)
_equo_get_installed_packages
;;
list)
case $line[3] in
available)
_equo_get_mirrors
;;
installed)
;;
*)
cmds=( ${(f)"$(equo query list --help |tr "\t" ":" | grep "^::[^:]" | sed 's/^::\([^:\ ]*\)[^:]*:*/\1:/')"} )
_describe -t commands 'command params' cmds
;;
esac
;;
belongs|description|license|mimetype|asociate|orphans|required|sets|slots|tags)
;;
*)
_equo_get_cmds $line[1]
;;
esac
;;
notice)
_equo_get_mirrors
;;
cleanup|status)
;;
*)
_equo_get_cmds $line[1]
;;
esac
;;
esac
--8<---------------cut here---------------start------------->8---
Can anyone help me. Thanks :-)
--
Best Regards, Clemens Schüller
Messages sorted by:
Reverse Date,
Date,
Thread,
Author