zsh-workers
 help / color / mirror / code / Atom feed
From: Doron Behar <doron.behar@gmail.com>
To: zsh-workers@zsh.org
Subject: Completion: How to emulate what this zstyle does natuarlly in a completion function?
Date: Sat, 26 May 2018 10:05:29 +0300	[thread overview]
Message-ID: <20180526070525.xx56q6ilizmslqf6@NUC.doronbehar.com> (raw)

Since I first installed zsh, probably when I ran `zsh-newuser-install`,
I had the following line in my `~/.zshrc`:

    zstyle ':completion:*:kill:*' command 'ps -u $USER -o pid,%cpu,tty,cputime,cmd'

I know that if I remove this line, the `kill` command's completion is
pretty poor and it completes processes from the current tty only. With
this statement in my `~/.zshrc`, `kill` is completed with all processes
of the current user.

My question is: How do I emulate a completion like that naturally within
a completion function? I want a certain command's option argument
completion to suggest all processes the current user just like when I
try to complete `kill`.


             reply	other threads:[~2018-05-26  7:05 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-05-26  7:05 Doron Behar [this message]
2018-05-27  3:45 ` Bart Schaefer
2018-05-27  8:53   ` Doron Behar

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=20180526070525.xx56q6ilizmslqf6@NUC.doronbehar.com \
    --to=doron.behar@gmail.com \
    --cc=zsh-workers@zsh.org \
    /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).