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

need help with compctl for NT


I want to complete  (For zsh 3.0.x only) the command "net stop" with the
of the command "net start". The output looks something like this:

These Windows 2000 services are started:

   Computer Browser
   Logical Disk Manager
   Net Logon

The command completed successfully.

I came up with a completion that seems to work:

     'c[-1,stop]' -s "$(net.exe start|grep.exe -v ^T|sed.exe -ne
-Z].*\)/"\1"/p')" \

The only problem is that this completion only collects the output of "net
on shell startup.  I would like the list to be updated every time i run "net
stop ..."

I tried using -K with a function like so:

function fooger {
    reply=(`net.exe start|grep.exe -v ^T|sed.exe -ne
/p'`); }

the problem with this approach is that it ignores the quotes and seperates
words anyway.

Thus, "Computer Browser" becomes
i.e, 2 separate array elements.

Firstly, is my assumption that the function will run every time i type 
"net stop <tab>" correct ?

If yes, then is there any way to get what I want to actually work ?


If all this is really confusing here's the bottom line:

How do i get a completion to be the dynamically updated output
from an external command, where the command output may
contain components with whitepace (just space usually)  ?

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