From: Bart Schaefer <schaefer@brasslantern.com>
To: zsh-users@sunsite.dk
Subject: Re: outputs of _users and _hosts to arrays
Date: Sun, 24 Jul 2005 09:33:14 +0000 [thread overview]
Message-ID: <1050724093315.ZM20733@candle.brasslantern.com> (raw)
In-Reply-To: <DC95ADD4-4F3C-4024-A9BE-242EC503D12C@jota.gsc.riken.go.jp>
On Jul 24, 4:05pm, Wataru Kagawa wrote:
}
} How can I add the outputs of _users and _hosts to arrays?
Those are completion functions. They don't have output. They just
call the compadd builtin.
So look up "compadd" in the manual, and you find:
-O ARRAY
If this option is given, the WORDS are _not_ added to the set
of possible completions. Instead, matching is done as usual
and all of the WORDS given as arguments that match the string
on the command line will be stored in the array parameter
whose name is given as ARRAY.
And therefore:
_users -O users
_hosts -O hosts
However, that only works inside functions called by the completion code.
You cannot employ _users and _hosts for generalized programming.
} users=( "$_users[@]" )
} hosts=( "$_hosts[@]" )
That syntax would mean that _users and _hosts were array variables; but
you seem to know that they're functions, so why did you try that?
next prev parent reply other threads:[~2005-07-24 9:33 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2005-07-24 7:05 Wataru Kagawa
2005-07-24 9:33 ` Bart Schaefer [this message]
2005-07-25 5:18 ` Wataru Kagawa
2005-07-25 5:38 ` Wataru Kagawa
2005-07-25 9:15 ` Motoi Washida
2005-07-26 1:56 ` Wataru Kagawa
2005-07-26 16:23 ` Motoi Washida
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=1050724093315.ZM20733@candle.brasslantern.com \
--to=schaefer@brasslantern.com \
--cc=zsh-users@sunsite.dk \
/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).