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

Re: Completion for pgrep and pkill



On May 23, 10:29pm, Michael Hwang wrote:
} 
} The completion relies on ps, which I know takes arguments differently
} on different platforms. Without any cross-platform experience, I can't
} say whether or not the completion will work properly on a non-GNU
} system. Someone might need to go through and change it to be more
} portable.

This is typically addressed by using zstyle for the "command" style to
allow the user to specify the program that will be used.  Look at the
_killall and _pids completers for examples of the use of _call_program,
and the documentation for the command style and for the processes and
process-names tags.

In this case you might have several contexts -- one for each of the ps
commands needed to produce the sid, ppid, pgid, etc. -- or you might
construct a single "ps" command that returns all the needed information
and then parse the output with zsh to extract the subset for each case.



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