zsh-workers
 help / color / mirror / code / Atom feed
* _arguments: Sets not working?
@ 2011-01-23 17:45 gi1242+zsh
  2011-01-23 18:48 ` Peter Stephenson
  2011-01-23 18:51 ` Mikael Magnusson
  0 siblings, 2 replies; 4+ messages in thread
From: gi1242+zsh @ 2011-01-23 17:45 UTC (permalink / raw)
  To: zsh-workers

Hi All,

It looks like argument sets separated by single hyphens are not working.
You can see the bug by trying to complete arguments of 'vncserver'. When
you ask for completions, none are returned. [Behaviour persists in
latest release from Git]

The vncserver code seems to use completion sets. From zshcomsys, line
3397 in zsh4.3.10:

    It is possible to specify multiple sets of options and arguments
    with the sets separated by single hyphens. The specifications before
    the first hyphen (if any) are shared by all the remaining sets.

(I couldn't get the documentation from git to build on my system, so
don't know if the behaviour has changed or not.)

When I remove lines 

      - start \
      - kill \
      - help \

from Completion/**/_vnc, then options are completed as expected. With
the above lines, I get no argument completions; and I can't figure out
how the syntax contradicts the man page. Is there a bug?

Thanks,

GI

-- 
'Disco' -- A din of iniquity.


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

* Re: _arguments: Sets not working?
  2011-01-23 17:45 _arguments: Sets not working? gi1242+zsh
@ 2011-01-23 18:48 ` Peter Stephenson
  2011-01-23 18:51 ` Mikael Magnusson
  1 sibling, 0 replies; 4+ messages in thread
From: Peter Stephenson @ 2011-01-23 18:48 UTC (permalink / raw)
  To: zsh-workers

On Sun, 23 Jan 2011 12:45:08 -0500
gi1242+zsh@gmail.com wrote:
> It looks like argument sets separated by single hyphens are not working.
> You can see the bug by trying to complete arguments of 'vncserver'. When
> you ask for completions, none are returned. [Behaviour persists in
> latest release from Git]

After I worked out what it's supposed to do, it did seem to be doing
it.  Probably there's some style or option that's interacting badly with
it.  See if it works with no styles or "interesting" shell options and if
so what it is that makes it stop working.

(It's harder without styles because you need to type leading '-' and
you don't get prompted with the name of what's missing, but as far as
I could tell it wasn't actually broken in that case either.)

-- 
Peter Stephenson <p.w.stephenson@ntlworld.com>
Web page now at http://homepage.ntlworld.com/p.w.stephenson/


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

* Re: _arguments: Sets not working?
  2011-01-23 17:45 _arguments: Sets not working? gi1242+zsh
  2011-01-23 18:48 ` Peter Stephenson
@ 2011-01-23 18:51 ` Mikael Magnusson
  2011-01-23 20:37   ` gi1242+zsh
  1 sibling, 1 reply; 4+ messages in thread
From: Mikael Magnusson @ 2011-01-23 18:51 UTC (permalink / raw)
  To: gi1242+zsh, zsh-workers

On 23 January 2011 18:45,  <gi1242+zsh@gmail.com> wrote:
> Hi All,
>
> It looks like argument sets separated by single hyphens are not working.
> You can see the bug by trying to complete arguments of 'vncserver'. When
> you ask for completions, none are returned. [Behaviour persists in
> latest release from Git]
>
> The vncserver code seems to use completion sets. From zshcomsys, line
> 3397 in zsh4.3.10:
>
>    It is possible to specify multiple sets of options and arguments
>    with the sets separated by single hyphens. The specifications before
>    the first hyphen (if any) are shared by all the remaining sets.
>
> (I couldn't get the documentation from git to build on my system, so
> don't know if the behaviour has changed or not.)
>
> When I remove lines
>
>      - start \
>      - kill \
>      - help \
>
> from Completion/**/_vnc, then options are completed as expected. With
> the above lines, I get no argument completions; and I can't figure out
> how the syntax contradicts the man page. Is there a bug?
>
> Thanks,
>
> GI

FWIW, the completion appears to work fine here. If i specify -help, no
other completions are offered, and same for -kill or the other set as
well. I even found i still had an Xvnc process running from a few
weeks ago when i pressed tab again after -kill :).

-- 
Mikael Magnusson


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

* Re: _arguments: Sets not working?
  2011-01-23 18:51 ` Mikael Magnusson
@ 2011-01-23 20:37   ` gi1242+zsh
  0 siblings, 0 replies; 4+ messages in thread
From: gi1242+zsh @ 2011-01-23 20:37 UTC (permalink / raw)
  To: Mikael Magnusson; +Cc: zsh-workers

[-- Attachment #1: Type: text/plain, Size: 1136 bytes --]

On Sun, Jan 23, 2011 at 07:51:25PM +0100, Mikael Magnusson wrote:

>> It looks like argument sets separated by single hyphens are not working.
>> You can see the bug by trying to complete arguments of 'vncserver'. When
>> you ask for completions, none are returned. [Behaviour persists in
>> latest release from Git]
>>
> FWIW, the completion appears to work fine here. If i specify -help, no
> other completions are offered, and same for -kill or the other set as
> well. I even found i still had an Xvnc process running from a few
> weeks ago when i pressed tab again after -kill :).

Thanks Peter/Mikael for looking into it and confirming it works on your
system. I found the problem was that I had

    alias vncserver='\vncserver -localhost -nolisten tcp'

in my .zshrc. The completer didn't know about -nolisten option, and so
was refusing to complete anything else for me.

I guess this is because the Xvnc options were missing from the
completer. I added them, and am attaching them to this message (diff
-u),

Thanks again,

GI

-- 
A topologist is a person who doesn't know the difference between a
coffee cup and a doughnut.

[-- Attachment #2: _vnc.Xvnc-options.patch --]
[-- Type: text/plain, Size: 3874 bytes --]

--- /free/tmp/src/zsh/Completion/X/Command/_vnc	2011-01-15 20:53:15.635331696 -0500
+++ _vnc	2011-01-23 15:28:37.489848153 -0500
@@ -6,13 +6,78 @@
 
 case $service in
   vncserver)
-    # currently lacking Xvnc arguments
+    # currently missing: bc, c, nologo, r, ttyxx, v
+    # Don't know values for -nolisten (other than tcp).
     _arguments \
       - start \
 	'-name:desktop name:_x_name' \
+	'-a[mouse acceleration (pixels)]:#:' \
+	'-ac[disable access control restrictions]' \
+	'-audit[set audit trail level]:int:' \
+	'-auth[select authorization file]:file:_files' \
+	'-bs[disable any backing store support]' \
+	'-c[turns off key-click]' \
+	'-cc[default color visual class]:int:' \
+	'-co[color database file]:file:_files' \
+	'-core[generate core dump on fatal error]' \
+	'-dpi[screen resolution in dots per inch]:int:' \
+	'-deferglyphs[defer loading of glyphs]:type:(none all 16)' \
+	'-f[bell base]:level (0-100):' \
+	'-fc[cursor font]:string:' \
+	'-fn[default font name]:string:' \
+	'-fp[default font path]:string:' \
+	'-help[prints message with these options]' \
+	'-I[ignore all remaining arguments]' \
+	'-ld[limit data space to N Kb]:int:' \
+	'-lf[limit number of open files to N]:int:' \
+	'-ls[limit stack space to N Kb]:int:' \
+	'-nolock[disable the locking mechanism]' \
+	'-logo[enable logo in screen saver]' \
+	'-nolisten[dont listen on protocol]:protocol:(tcp)' \
+	'-p[screen-saver pattern duration (minutes)]:time (minutes):' \
+	'-pn[accept failure to listen on all ports]' \
+	'-nopn[reject failure to listen on all ports]' \
+	'-r[turns off auto-repeat]' \
+	'-s[screen-saver timeout (minutes)]:timeout (minutes):' \
+	'-su[disable any save under support]' \
+	'-t[mouse threshold]:pixels:' \
+	'-terminate[terminate at server reset]' \
+	'-to[connection time out]:time:' \
+	'-tst[disable testing extensions]' \
+	'-v[screen-saver without video blanking]' \
+	'-wm[WhenMapped default backing-store]' \
+	'-x[loads named extension at init time ]:string:' \
+	'-query[contact named host for XDMCP]:host-name:_hosts' \
+	'-broadcast[broadcast for XDMCP]' \
+	'-indirect[contact named host for indirect XDMCP]:host-name:_hosts' \
+	'-port[UDP port number to send messages to]:port:' \
+	'-once[Terminate server after one session]' \
+	'-class[specify display class to send in manage]:display-class:' \
+	'-cookie[specify the magic cookie for XDMCP]:xdm-auth-bits:' \
+	'-displayID[manufacturer display ID for request]:display-id:' \
 	'-geometry:geometry:(1600x1200 1280x1024 1152x864 1024x768 800x600 640x480)' \
 	'-depth:pixel depth:(8 16 24 32)' \
 	'-pixelformat:pixel format' \
+	'-udpinputport[UDP port for keyboard/pointer data]:port:' \
+	'-rfbport[TCP port for RFB protocol]:port:' \
+	'-rfbwait[max time in ms to wait for RFB client]:time:' \
+	'-nocursor[dont put up a cursor]' \
+	'-rfbauth[use authentication on RFB protocol]:passwd-file:_files' \
+	'-httpd[serve files via HTTP from here]:dir:_files -/' \
+	'-httpport[port for HTTP]:port:' \
+	'-deferupdate[time in ms to defer updates (default 40)]:time (ms):' \
+	'-economictranslate[less memory-hungry translation]' \
+	'-lazytight[disable "gradient" filter in tight encoding]' \
+	'-desktop[VNC desktop name (default x11)]:name:' \
+	'-alwaysshared[always treat new clients as shared]' \
+	'-nevershared[never treat new clients as shared]' \
+	'-dontdisconnect[dont disconnect existing clients for new non-shared connections]' \
+	'-viewonly[let clients only to view the desktop]' \
+	'-localhost[only allow connections from localhost]' \
+	'-interface[only bind to specified interface address]:ipaddr:' \
+	'-inetd[Xvnc is launched by inetd]' \
+	'-compatiblekbd[set META key = ALT key as in the original VNC]' \
+	'-version[report Xvnc version on stderr]' \
 	'1:: :_guard "(|:[0-9]#)" "display number"' \
       - kill \
 	"-kill:display number:($displays)" \

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

end of thread, other threads:[~2011-01-23 21:02 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-01-23 17:45 _arguments: Sets not working? gi1242+zsh
2011-01-23 18:48 ` Peter Stephenson
2011-01-23 18:51 ` Mikael Magnusson
2011-01-23 20:37   ` gi1242+zsh

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