Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: Completion for pgrep and pkill
- X-seq: zsh-workers 26988
- From: Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx>
- To: Michael Hwang <nomex45@xxxxxxxxx>, zsh-workers@xxxxxxxxxx
- Subject: Re: Completion for pgrep and pkill
- Date: Sun, 24 May 2009 00:42:02 -0700
- In-reply-to: <153994.78930.qm@xxxxxxxxxxxxxxxxxxxxxxxxxxx>
- Mailing-list: contact zsh-workers-help@xxxxxxxxxx; run by ezmlm
- References: <153994.78930.qm@xxxxxxxxxxxxxxxxxxxxxxxxxxx>
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