zsh-workers
 help / color / mirror / code / Atom feed
* PATCH: _pon, poff
@ 2006-10-07  8:50 Clint Adams
  2006-10-29 12:46 ` Jörg Sommer
  0 siblings, 1 reply; 3+ messages in thread
From: Clint Adams @ 2006-10-07  8:50 UTC (permalink / raw)
  To: zsh-workers; +Cc: Jörg Sommer

It would probably be saner to check for running pppds for poff.

Index: Completion/Unix/Command/_pon
===================================================================
RCS file: /cvsroot/zsh/zsh/Completion/Unix/Command/_pon,v
retrieving revision 1.1
diff -u -r1.1 _pon
--- Completion/Unix/Command/_pon	4 Oct 2006 09:40:40 -0000	1.1
+++ Completion/Unix/Command/_pon	7 Oct 2006 08:49:24 -0000
@@ -1,7 +1,23 @@
-#compdef pon
+#compdef pon poff
 
-provider=(/etc/ppp/peers/*(:t))
+case "$service" in
+  (pon)
 
 _arguments \
   '(-q --quick)'{-q,--quick}'[hangs up after all ip-up scripts are run]' \
-  '1:provider to call:(${provider[@]})'
+  '1:provider to call:_files -W /etc/ppp/peers'
+
+  ;;
+
+  (poff)
+_arguments \
+  '-r[drop the line and redial]' \
+  '-d[toggle state of debug option]' \
+  '-c[renegotiate compression]' \
+  '-a[stop all pppds]' \
+  '-h[help]' \
+  '-v[version]' \
+  '1:provider to disconnect:_files -W /etc/ppp/peers'
+
+  ;;
+esac


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

* Re: PATCH: _pon, poff
  2006-10-29 12:46 ` Jörg Sommer
@ 2006-10-27 14:46   ` Peter Stephenson
  0 siblings, 0 replies; 3+ messages in thread
From: Peter Stephenson @ 2006-10-27 14:46 UTC (permalink / raw)
  To: zsh-workers

=?UTF-8?Q?J=C3=B6rg?= Sommer wrote:
> Hello Clint,
> 
> Clint Adams <clint@zsh.org> wrote:
> >    '(-q --quick)'{-q,--quick}'[hangs up after all ip-up scripts are run]' \
> > -  '1:provider to call:(${provider[@]})'
> > +  '1:provider to call:_files -W /etc/ppp/peers'
> 
> Only for my understanding: Why you can use _files here? Doesn't this tag
> the completions as files even though they are hosts? Does this cause any
> problems?

The basic behaviour of _files is just to add the filenames as strings.
There is additional behaviour (showing types, etc.), but it relies on
being able to find the file added.  If the completion system doesn't
find the file it will just fall back to treating it like an ordinary
string.  In this case, it actually will find the file; but all that's
likely to happen is a few extra things show up.  The most distracting
possibility is if you're using the file-list style I added.  Then you
might see long listings of the file in that directory.  Outside listings,
however, you shouldn't see any problems.

-- 
Peter Stephenson <pws@csr.com>                  Software Engineer
CSR PLC, Churchill House, Cambridge Business Park, Cowley Road
Cambridge, CB4 0WZ, UK                          Tel: +44 (0)1223 692070


To access the latest news from CSR copy this link into a web browser:  http://www.csr.com/email_sig.php


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

* Re: PATCH: _pon, poff
  2006-10-07  8:50 PATCH: _pon, poff Clint Adams
@ 2006-10-29 12:46 ` Jörg Sommer
  2006-10-27 14:46   ` Peter Stephenson
  0 siblings, 1 reply; 3+ messages in thread
From: Jörg Sommer @ 2006-10-29 12:46 UTC (permalink / raw)
  To: zsh-workers

Hello Clint,

Clint Adams <clint@zsh.org> wrote:
> -provider=(/etc/ppp/peers/*(:t))
> +case "$service" in
> +  (pon)
>  
>  _arguments \
>    '(-q --quick)'{-q,--quick}'[hangs up after all ip-up scripts are run]' \
> -  '1:provider to call:(${provider[@]})'
> +  '1:provider to call:_files -W /etc/ppp/peers'

Only for my understanding: Why you can use _files here? Doesn't this tag
the completions as files even though they are hosts? Does this cause any
problems?

Bye, Jörg.
-- 
Ich halte ihn zwar für einen Schurken und das was er sagt für
falsch – aber ich bin bereit mein Leben dafür einzusetzen, daß
er seine Meinung sagen kann.		(Voltair)


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

end of thread, other threads:[~2006-10-30 15:47 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2006-10-07  8:50 PATCH: _pon, poff Clint Adams
2006-10-29 12:46 ` Jörg Sommer
2006-10-27 14:46   ` Peter Stephenson

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