Commit Graph

13 Commits

Author SHA1 Message Date
Wang Long 1a6391b03f Revert "simplify ps command"
This reverts commit 067ce21f7a.

Signed-off-by: Wang Long <long.wanglong@huawei.com>
2016-10-10 09:27:07 +08:00
Wang Long 067ce21f7a simplify ps command
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>
2016-09-30 14:54:30 +08:00
Shukui Yang 993126259c Remove the workaround which add a -- flag to runc ps command and add integration for ps -eaf
Signed-off-by: Shukui Yang <yangshukui@huawei.com>
2016-09-24 12:20:52 +08:00
Shukui Yang d5dd8931c5 fix ps/exec command parameter error
Signed-off-by: Shukui Yang <yangshukui@huawei.com>
2016-09-18 09:34:06 +08:00
Zhao Lei cdb552d341 ps: Support muitiple ps arguments
Before patch:
 | # ./runc ps test -- -e -f
 |   PID TTY          TIME CMD
 | 29046 pts/2    00:00:00 sh  <-- The -f option was skipped
 | #

After patch:
 | # ./runc ps test -- -e -f
 | UID        PID  PPID  C STIME TTY          TIME CMD
 | root     29046 29038  0 Jul06 pts/2    00:00:00 sh
 | #

Reported-by: Qiang Huang <h.huangqiang@huawei.com>

Signed-off-by: Zhao Lei <zhaolei@cn.fujitsu.com>
2016-07-07 18:42:47 +08:00
Zhao Lei f5a95fa244 cli: Workaround for ps's argument
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>
2016-07-07 18:17:13 +08:00
Zhao Lei 71929e0f9d Fix ps argument manual
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>
2016-06-17 19:07:30 +08:00
Mrunal Patel a753b06645 Replace github.com/codegangsta/cli by github.com/urfave/cli
The package got moved to a different repository

Signed-off-by: Mrunal Patel <mrunalp@gmail.com>
2016-06-06 11:47:20 -07:00
Hushan Jia 772505aa24 cleanup ps.go
The code is called in both cases so remove the duplicate one.

Signed-off-by: Hushan Jia <hushan.jia@gmail.com>
2016-06-06 02:36:11 +08:00
Zhao Lei 34d100f970 manual: add manual for ps command
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>
2016-05-25 17:32:14 +08:00
Qiang Huang 8477638aab Update cli package
The old one has bug when showing help message for IntFlags.

Signed-off-by: Qiang Huang <h.huangqiang@huawei.com>
2016-05-10 13:58:09 +08:00
Michael Crosby bb8591138b Add json format to ps command
For programatic parsing add a json format option to the new `runc ps`
command.

Signed-off-by: Michael Crosby <crosbymichael@gmail.com>
2016-04-25 15:21:07 -07:00
Qiang Huang 8cf9ca4bcf Add ps command
Signed-off-by: Qiang Huang <h.huangqiang@huawei.com>
2016-04-22 08:06:35 +08:00