* directory completion for a function
@ 2006-02-10 7:40 Stefan Reichör
2006-02-10 7:51 ` Frank Terbeck
0 siblings, 1 reply; 4+ messages in thread
From: Stefan Reichör @ 2006-02-10 7:40 UTC (permalink / raw)
To: zsh-users
Hi!
I created the following function to create a tarball a given directory:
function create-tgz {
local archive_name
archive_name="$1.tar.gz"
archive_name=${archive_name/\//}
tar cvfz "$archive_name" "$1"
echo "Created archive $archive_name"
}
Now I would like to have completion for directory names for that
function.
How can I achieve that?
Stefan.
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: directory completion for a function
2006-02-10 7:40 directory completion for a function Stefan Reichör
@ 2006-02-10 7:51 ` Frank Terbeck
2006-02-10 8:05 ` Frank Terbeck
0 siblings, 1 reply; 4+ messages in thread
From: Frank Terbeck @ 2006-02-10 7:51 UTC (permalink / raw)
To: zsh-users
Stefan Reichör <stefan@xsteve.at> wrote:
> function create-tgz {
[...]
> Now I would like to have completion for directory names for that
> function. How can I achieve that?
compdef _dirs create-tgz
Regards, Frank
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: directory completion for a function
2006-02-10 7:51 ` Frank Terbeck
@ 2006-02-10 8:05 ` Frank Terbeck
2006-02-20 14:59 ` Marc Chantreux
0 siblings, 1 reply; 4+ messages in thread
From: Frank Terbeck @ 2006-02-10 8:05 UTC (permalink / raw)
To: zsh-users
Frank Terbeck <frank.terbeck@rwth-aachen.de> wrote:
> Stefan Reichör <stefan@xsteve.at> wrote:
> > function create-tgz {
> [...]
> > Now I would like to have completion for directory names for that
> > function. How can I achieve that?
>
> compdef _dirs create-tgz
compdef _directories create-tgz
_dirs is for the dirs builtin... sorry
Regards, Frank
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: directory completion for a function
2006-02-10 8:05 ` Frank Terbeck
@ 2006-02-20 14:59 ` Marc Chantreux
0 siblings, 0 replies; 4+ messages in thread
From: Marc Chantreux @ 2006-02-20 14:59 UTC (permalink / raw)
To: zsh-users
Frank Terbeck wrote:
> compdef _directories create-tgz
cool ! what if i need arguments ? I'm trying to replace this file :
#compdef eev
_sub_commands preinscription login
by the equivalent command.
regards
mc
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2006-02-20 14:58 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2006-02-10 7:40 directory completion for a function Stefan Reichör
2006-02-10 7:51 ` Frank Terbeck
2006-02-10 8:05 ` Frank Terbeck
2006-02-20 14:59 ` Marc Chantreux
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).