From: "arno." <arno.@no-log.org>
To: zsh-workers@sunsite.dk
Subject: PATCH: _apt-file
Date: Sun, 17 Dec 2006 15:58:41 +0100 [thread overview]
Message-ID: <20061217145841.GA558@localhost.localdomain> (raw)
[-- Attachment #1: Type: text/plain, Size: 2267 bytes --]
Hi,
Here a completion script suggestion for apt-file, a command used on
Debian.
diff -Nur zsh/Completion/Debian/Command/_apt-file zsh~/Completion/Debian/Command/_apt-file
--- zsh/Completion/Debian/Command/_apt-file 1970-01-01 01:00:00.000000000 +0100
+++ zsh~/Completion/Debian/Command/_apt-file 2006-12-17 15:55:56.000000000 +0100
@@ -0,0 +1,55 @@
+#compdef apt-file
+
+_apt-file() {
+ local -a arguments
+ local state line cmds
+ arguments=(
+ '(--cache -c)'{--cache,-c}'[cache directory]:directory:_directories'
+ '(-v --verbose)'{-v,--verbose}'[verbose]'
+ '(--cdrom-mount -d)'{--cdrom-mount,-d}'[cdrom mount point]:directory:_directories'
+ '(--ignore-case -i)'{--ignore-case,-i}'[ignore case]'
+ '(--regexp -r)'{--regexp,-r}'[regular expression]'
+ '(-V --version)'{-V,--version}'[version]'
+ '(-a --architecture)'{-a,--architecture}'[architecture]:architecture:(alpha arm hppa hurd-i386 i386 ia64 m68k mips mipsel powerpc s390 sparc)'
+ '(-s --sources-list)'{-s,--sources-list}'[source.list file]:file:_files'
+ '(-l --package-only)'{-l,--package-only}'[only display package name]'
+ '(-F --fixed-string)'{-F,--fixed-string}'[do not expand search pattern]'
+ '(-y --dummy)'{-y,--dummy}'[run in dummy mode]'
+ '(-h --help)'{-h,--help}'[display help screen]'
+ '1: :->cmds'
+ '*: :->args'
+ )
+ _arguments -S $arguments
+
+ case $state in
+ cmds)
+ cmds=(
+ 'update:Resynchronize package contents'
+ 'search:Search in which package file is included'
+ 'list:List contents of a package'
+ 'show:Alias for list'
+ 'purge:remove all Contents-<ARCH>.gz files in cache directory'
+ )
+ _describe -t commands 'apt-list command' cmds && ret=0
+ ;;
+ args)
+ case $line[1] in
+ search)
+ _message "pattern"
+ ;;
+ list|show)
+ _deb_packages avail
+ ;;
+ update|purge)
+ # do nothing
+ ;;
+ *)
+ _message "command $line[1] not available"
+ ;;
+ esac
+ ;;
+ esac
+
+}
+
+_apt-file "$@"
[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 189 bytes --]
reply other threads:[~2006-12-17 14:58 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=20061217145841.GA558@localhost.localdomain \
--to="arno."@no-log.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).