zsh-workers
 help / color / mirror / code / Atom feed
* Per command _redirect completion
@ 2002-02-25  5:59 Felix Rosencrantz
  2002-02-25  8:18 ` Sven Wischnowsky
  2002-02-25  9:47 ` Oliver Kiddle
  0 siblings, 2 replies; 15+ messages in thread
From: Felix Rosencrantz @ 2002-02-25  5:59 UTC (permalink / raw)
  To: zsh-workers

Below is a proposed change for the _redirect completion function.  If there
is a function with the name _redirect:COMMAND, that function is called
to perform completion.  Otherwise, the default behavior of completing files
is performed.  This is the way we do variable specific dispatch for _value.

If there are no objections, I'll create a real diff and checkin.

-FR.
---------------------------------------------------------------------------
#compdef -redirect-

if (( $+functions[_redirect:$words[1]] )); then
    "_redirect:$words[1]" "$@"
else
        _files
fi

__________________________________________________
Do You Yahoo!?
Yahoo! Sports - Coverage of the 2002 Olympic Games
http://sports.yahoo.com


^ permalink raw reply	[flat|nested] 15+ messages in thread
* Re: Per command _redirect completion
@ 2002-03-02 16:28 Felix Rosencrantz
  0 siblings, 0 replies; 15+ messages in thread
From: Felix Rosencrantz @ 2002-03-02 16:28 UTC (permalink / raw)
  To: zsh-workers

Still having problem with the latest uncommitted patch:  When trying to
complete TZ I get:
_do_type:31: ':' without '?'

Which only happens from a shell where .zcompdump didn't pre-exist.  Subsequent
shells seem to work.

Also, completion for command flags/args doesn't work.  The command's completion
function is not being called.
I try:
 gzip -<TAB> 

in an empty directory and get "no match for: `file'".

I like the new changes a lot (assuming they work).  It wasn't clear to me how
completion for different redirection operators will work.  It seems that you
can only specify one redirection completer.  Which will have to do the
remaining work of figuring what completion function to use, if you want one for
input and one for output.  (And another for stderr, etc.)  It seems like that
information should be part of the compdef call.  All my command specific
redirection completers  currently are for commands that provide output, the
input comes from command line args, so it didn't matter.  But I can easily see
there being commands where input and output files from redirection are
completely different.  So the user will want to use different functions.

-FR


__________________________________________________
Do You Yahoo!?
Yahoo! Sports - sign up for Fantasy Baseball
http://sports.yahoo.com


^ permalink raw reply	[flat|nested] 15+ messages in thread

end of thread, other threads:[~2002-03-04  8:52 UTC | newest]

Thread overview: 15+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-02-25  5:59 Per command _redirect completion Felix Rosencrantz
2002-02-25  8:18 ` Sven Wischnowsky
2002-02-25  9:47 ` Oliver Kiddle
2002-02-26  6:56   ` Felix Rosencrantz
2002-02-26  8:44     ` Sven Wischnowsky
2002-02-27  9:35       ` Sven Wischnowsky
2002-02-27 13:10         ` Oliver Kiddle
2002-02-27 14:30           ` Sven Wischnowsky
2002-02-28  6:35         ` Felix Rosencrantz
2002-02-28  8:42           ` Sven Wischnowsky
2002-03-01  5:47             ` Bart Schaefer
2002-03-04  8:50               ` Sven Wischnowsky
2002-03-01  9:24             ` Oliver Kiddle
2002-03-01 10:49               ` Sven Wischnowsky
2002-03-02 16:28 Felix Rosencrantz

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).