From: Stephen Rueger <stephen.rueger@rechnerpost.org>
To: zsh-workers@sunsite.dk
Subject: Re: PATCH: _module-assistant
Date: Sun, 17 Apr 2005 18:59:57 +0200 [thread overview]
Message-ID: <d9haj2-v1s.ln1@rechnerpost.org> (raw)
In-Reply-To: <20050417161535.GA31655@scowler.net>
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain, Size: 2893 bytes --]
Hi.
Please incorporate whatever you want from my version of _module-assistant
#compdef module-assistant m-a
_module-assistant() {
_arguments - -A \
'(-t --text)'{-t,--text}"[don't use dialog UI]" \
'(-k --kerneldir)'{-k,--kerneldir}'[kernel source directory]:kernel source directory:_files -/' \
'(-l --kvers-list)'{-l,--kvers-list}'[list of kernel version numbers]:kernel version number:' \
'(-v --verbose)'{-v,--verbose}'[show more informations]' \
'(-n --no-rebuild)'{-n,--no-rebuild}'[don''t rebuild existing packages]' \
'(-f --force)'{-f,--force}'[force build/download]' \
'(-u --user-dir)'{-u,--user-dir}'[override default dir]:directory:_files -/' \
'(-i --ignore-failures)'{-i,--ignore-failures}'[ignore failed builds]' \
'(-s --apt-search)'{-s,--apt-search}'[use apt-cache for searching]' \
'(-h --help)'{-h,--help}'[print usage overview]' \
'*::command:_m-a-commands'
}
_m-a-commands() {
local cmd ret=1 m_a_commands
m_a_commands=(
update:"synchronize version index files"
prepare:"install required kernel headers package"
fakesource:"install required kernel source package"
list:"a print a list of details about available packages"
list-available:"b print a list of details about available packages "
la:"c print a list of details about available packages "
list-installed:" print a list of details about installed packages "
li:"print a list of details about installed packages "
search:"search for packages"
get:"install specified source package"
build:"build specified packages"
install:"install specified packages"
auto-install:"do all necessary steps to install specified packages"
clean:"clear build directories of the kernel packages"
purge:"clear cache and remove all binary packages of source package"
)
if (( CURRENT == 1 )); then
_describe -t commands 'module-assistant command' m_a_commands
else
case $words[1] in
(update|prepare|fakesource|clean)
cmd=noop
;;
(list*|la|li|search)
cmd=ep
;;
(get|build|(|auto-)install|purge)
cmd=bp
;;
esac
_tags commands && _call_function ret _m-a-$cmd
fi
return ret
}
_m-a-noop() {
_message nothing
}
_m-a-bp() {
_wanted "package" expl "source package" \
compadd -- /var/cache/modass/*.avail_version(:t:r)
#compadd -- /usr/share/modass/packages/^generic.sh(:t)
# which one of the above is better? don't know enough about m-a to
# decide :-/
}
_m-a-ep() {
_wanted "package" expl "source package" \
compadd -- /var/cache/modass/*.avail_version(:t:r) all alli
#compadd -- /usr/share/modass/packages/^generic.sh(:t) all alli
# which one of the above is better? don't know enough about m-a to
# decide :-/
}
_module-assistant "$@"
--
Stephen Rüger
stephen.rueger@rechnerpost.org
next prev parent reply other threads:[~2005-04-17 17:35 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2005-04-17 16:15 Clint Adams
2005-04-17 16:59 ` Stephen Rueger [this message]
2005-04-17 18:46 ` Clint Adams
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=d9haj2-v1s.ln1@rechnerpost.org \
--to=stephen.rueger@rechnerpost.org \
--cc=zsh-workers@sunsite.dk \
/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).