the `-p pidlist` flag of `ps` command selects the process whose process
ID numbers apper in `pidlist`.[1]
This patch use `-p pidlist` to filter process which we want.
[1]: http://man7.org/linux/man-pages/man1/ps.1.html
Signed-off-by: Wang Long <long.wanglong@huawei.com>
Currently, ps command can not support argument:
(But following usage is in manual)
| # ./runc ps 123 -ef
| Incorrect Usage.
|
| NAME:
| runc ps - ps displays the processes running inside a container
|
| USAGE:
| runc ps [command options] <container-id> [ps options]
|
| OPTIONS:
| --format value, -f value select one of: table or json
|
| flag provided but not defined: -ef
| #
Instead of using odd command like:
| # ./runc ps -- 123 -ef
We can make it seems little better:
| # ./runc ps 123 -- -ef
| UID PID PPID C STIME TTY TIME CMD
| root 29046 29038 0 11:18 pts/2 00:00:00 sh
| #
This patch also fixed manual which can not working in current
code.
Closes#788
Signed-off-by: Zhao Lei <zhaolei@cn.fujitsu.com>
Argument of "ps options" for ps command is a optional parameter.
Should use [] instead of <> in manual.
Signed-off-by: Zhao Lei <zhaolei@cn.fujitsu.com>
This patch add manual for ps command, and remove remove example
for --format command, which is not necessary.
Suggested-by: Aleksa Sarai <asarai@suse.de>
Signed-off-by: Zhao Lei <zhaolei@cn.fujitsu.com>