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

Re: Add some tips in `compadd` docs about groups



On 5/19/25 3:31 AM, dana wrote:
if it's something that other functions might use we could add a
_nonkernel_pids or whatever. or extend _pids with some more options for
filtering the output. but i don't know how common it is that you need to
exclude kernel threads for one specific tool. if a user wants to do it
generally (which they might because they're usually pointless) they can
set the command style on the processes tag:

   zstyle ':completion:*:*:processes' command 'ps -N -p2 --ppid=2'

I saw this but didn't really have enough interest in answering,
if the completer really wanted to check with specific ps options, it could
use zstyle to check the current context for the command style, if it is set.
just use _pids(giving the user power), if not, set the style for the current
context with your default options, then use _pids.

though the program seems to have `subcommands' and the completer doesn't take
that into account and update the curcontext parameter to include the subcommand
into the command spot for more granular use of zstyle.





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