Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: _command_names and path
- X-seq: zsh-workers 16507
- From: Sven Wischnowsky <wischnow@xxxxxxxxx>
- To: zsh-workers@xxxxxxxxxx
- Subject: Re: _command_names and path
- Date: Mon, 28 Jan 2002 17:31:32 +0100
- In-reply-to: <20020127204311.GA32345@xxxxxxxx>
- Mailing-list: contact zsh-workers-help@xxxxxxxxxx; run by ezmlm
- References: <20020121172829.GB6491@xxxxxxxx> <15437.17263.353779.491314@xxxxxxxxxxxxxxxxxx> <20020127204311.GA32345@xxxxxxxx>
Clint Adams wrote:
> > Probably changing _command_names to use `_files -P/ -W/ ...' if `.' is
> > not in $path.
>
> ...
> +
> +if [[ -n "$path[(r).]" ]]; then
> + defs=( "$defs[@]"
> + 'executables:executable file or directory:_path_files -/g \*\(-\*\)'
> + )
> +else
> + defs=( "$defs[@]"
> + 'executables:executable file or directory:_files -P/ -W/ -/g \*\(-\*\)'
> + )
> +fi
I've been thinking about this, too, at the weekend. We need to
complete files after things like `./<TAB>', too.
So we can make this slightly simpler.
Bye
Sven
Index: Completion/Zsh/Type/_command_names
===================================================================
RCS file: /cvsroot/zsh/zsh/Completion/Zsh/Type/_command_names,v
retrieving revision 1.4
diff -u -r1.4 _command_names
--- Completion/Zsh/Type/_command_names 2002/01/27 21:57:54 1.4
+++ Completion/Zsh/Type/_command_names 2002/01/28 16:31:03
@@ -10,15 +10,10 @@
'commands:external command:compadd -k commands'
)
-if [[ -n "$path[(r).]" ]]; then
+[[ -n "$path[(r).]" || $PREFIX = */* ]] &&
defs=( "$defs[@]"
'executables:executable file or directory:_path_files -/g \*\(-\*\)'
)
-else
- defs=( "$defs[@]"
- 'executables:executable file or directory:_files -P/ -W/ -/g \*\(-\*\)'
- )
-fi
if [[ "$1" = -e ]]; then
shift
--
Sven Wischnowsky wischnow@xxxxxxxxx
Messages sorted by:
Reverse Date,
Date,
Thread,
Author