zsh-users
 help / color / mirror / code / Atom feed
* compctl
@ 1996-09-06 22:52 Julio Garcia
  0 siblings, 0 replies; 2+ messages in thread
From: Julio Garcia @ 1996-09-06 22:52 UTC (permalink / raw)
  To: zsh mailing list

Hi,

I have been playing with compctl and have a question regarding the -l
option.  I have a simple command that allows me to run other commands as
root (or any other user).  99% of the time, I run it something like
this:

	sys [-u <user>] cmd <cmd options/args/...>

I have the following comctl for it and it works pretty well:

compctl  -x 'p[1] s[-u]' -u - \
            'p[2] w[1,-u]' -u - \
            'p[1]' -c - \
            'p[2] W[1,-u*]' -c - \
            'p[3] w[1,-u]' -c \
            -- sys

The problem is that I would like smart completion on the command that
is passed in to sys.  I tried with some success to use the -l option:

compctl  -x 'p[1] s[-u]' -u - \
            'p[2] w[1,-u]' -u - \
            'p[1]' -c - \
            'p[2] W[1,-u*]' -c - \
            'p[3] w[1,-u]' -c - \
            'W[-1,*]' -l '' \
            -- sys

This also works most of the time.  It starts to get confused with
things like

	sys -u root exec ...

or

	exec sys -u root ...

This may be too much to ask.  It's no big deal, but I am curious
about it.

Any thoughts?

-- 
Julio Garcia - julio@fc.hp.com - http://spyder.fc.hp.com/julio/
	     - (970) 229-3168  - FAX (970) 229-7182


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

* compctl
@ 1996-07-19 21:42 Brent Stone
  0 siblings, 0 replies; 2+ messages in thread
From: Brent Stone @ 1996-07-19 21:42 UTC (permalink / raw)
  To: zsh-users


is it possible to match for ytalk with the standard completion flags?
here's the argument synopsis for ytalk:
    name          - some user on your machine
    name@host     - some user on a different machine
    name#tty      - some user on a particular terminal
    name#tty@host - some user on a particular tty on a different machine
    name@host#tty - same as "name#tty@host"
I could complete for users easily enough... but i'd like to also match
the others with something like an 's[]' construct with pattern maching
so i could match ttys after a # in the field and/or hostnames after an @ 
in a field.
this could be used for just about anything that specifies an email address
and would also be useful in completions for programs like 'dd'.
							thanks,
							Robert Stone



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

end of thread, other threads:[~1996-09-06 22:03 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1996-09-06 22:52 compctl Julio Garcia
  -- strict thread matches above, loose matches on Subject: below --
1996-07-19 21:42 compctl Brent Stone

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