zsh-users
 help / color / mirror / code / Atom feed
From: Amol Deshpande <amold@MICROSOFT.com>
To: "'zsh-users@math.gatech.edu'" <zsh-users@math.gatech.edu>
Subject: need help with compctl for NT
Date: Wed, 23 Jun 1999 12:23:11 -0700	[thread overview]
Message-ID: <CDF457DA4ADAD11193E50008C724CC39043FD3AC@RED-MSG-10> (raw)

hi,

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

These Windows 2000 services are started:

   Computer Browser
   Logical Disk Manager
   Messenger
   Net Logon
   Workstation

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
's/\([A-Z][a-zA
-Z].*\)/"\1"/p')" \


The only problem is that this completion only collects the output of "net
start"
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 {
    IFS=\t\n
    reply=(`net.exe start|grep.exe -v ^T|sed.exe -ne
's/\([A-Z][a-zA-Z].*\)/"\1"
/p'`); }

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

Thus, "Computer Browser" becomes
"Computer
Browser"
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 ?

thanks,.
-amol

PS:
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)  ?


             reply	other threads:[~1999-06-27 10:03 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1999-06-23 19:23 Amol Deshpande [this message]
1999-06-27 13:30 ` Peter Stephenson

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CDF457DA4ADAD11193E50008C724CC39043FD3AC@RED-MSG-10 \
    --to=amold@microsoft.com \
    --cc=zsh-users@math.gatech.edu \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).