Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: PostgreSQL completion



On Wed, Sep 15, 2004 at 10:28:03AM +0100, Peter Stephenson wrote:
> Dominic Mitchell wrote:
> > 1.  I use psql to get information from the database.  But what happens
> > if psql spits out an error?  At the moment, it just messes up the
> > display...
> 
> The usual method is simply to add 2>/dev/null to the command.  If you
> want to be smarter about errors you need to work harder.

Aha, good point.  I'll do that.  No need to be too clever, the same
error will be displayed at some point anyway.

> > 2.  How do you complete either a hostname or a path at the same point?
> > PostgreSQL accepts either a hostname or a directory containing a socket
> > after -h.
> 
> The easy way is _alternative, assuming you have functions for both
> cases.  _ssh does (after a bit of editing):
> 
>   _alternative \
>     'hosts:remote host name:_ssh_hosts' \
>     'users:login name:_ssh_users -qS@'

Excellent, I shall do that.  I tried looking for an example, I'll have
to try harder next time.  :-)

-Dom



Messages sorted by: Reverse Date, Date, Thread, Author