aboutsummaryrefslogtreecommitdiff
path: root/toys
diff options
context:
space:
mode:
Diffstat (limited to 'toys')
-rw-r--r--toys/posix/ps.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/toys/posix/ps.c b/toys/posix/ps.c
index bb6bcbad..011a43e3 100644
--- a/toys/posix/ps.c
+++ b/toys/posix/ps.c
@@ -1151,6 +1151,7 @@ static void shared_main(void)
void ps_main(void)
{
+ char **arg;
struct dirtree *dt;
char *not_o;
int i;
@@ -1170,6 +1171,10 @@ void ps_main(void)
comma_args(TT.ps.k, &TT.kfields, "bad -k", parse_ko);
dlist_terminate(TT.kfields);
+ // It's undocumented, but traditionally extra arguments are extra -p args
+ for (arg = toys.optargs; *arg; arg++)
+ if (parse_rest(&TT.pp, *arg, strlen(*arg))) error_exit_raw(*arg);
+
// Figure out which fields to display
not_o = "%sTTY,TIME,CMD";
if (toys.optflags&FLAG_f)