Skip to content

ps: improve the parameter output of the ps command#664

Open
Franklin-Qi wants to merge 1 commit intouutils:mainfrom
Franklin-Qi:improve-the-parameters-output-of-the-ps-command
Open

ps: improve the parameter output of the ps command#664
Franklin-Qi wants to merge 1 commit intouutils:mainfrom
Franklin-Qi:improve-the-parameters-output-of-the-ps-command

Conversation

@Franklin-Qi
Copy link
Copy Markdown
Contributor

@Franklin-Qi Franklin-Qi commented Apr 8, 2026

Improve the parameter output of the ps command so thatcargo run -q ps -A -e does not report errors.

$ ps -A -e |head -n5 && cargo run -q ps -A -e |head -n5
    PID TTY          TIME CMD
      1 ?        00:00:57 systemd
      2 ?        00:00:00 kthreadd
      3 ?        00:00:00 pool_workqueue_release
      4 ?        00:00:00 kworker/R-rcu_gp
 PID     TTY    TIME      CMD 
 1       ?      00:00:57  systemd 
 2       ?      00:00:00  kthreadd 
 3       ?      00:00:00  pool_workqueue_release 
 4       ?      00:00:00  kworker/R-rcu_gp 

Fix #669

@codecov
Copy link
Copy Markdown

codecov bot commented Apr 8, 2026

Codecov Report

❌ Patch coverage is 64.28571% with 5 lines in your changes missing coverage. Please review.
✅ Project coverage is 19.20%. Comparing base (251f9b3) to head (c1801fd).
⚠️ Report is 2 commits behind head on main.

Files with missing lines Patch % Lines
src/uu/ps/src/ps.rs 0.00% 4 Missing ⚠️
src/uu/ps/src/process_selection.rs 0.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #664      +/-   ##
==========================================
+ Coverage   19.16%   19.20%   +0.03%     
==========================================
  Files          68       68              
  Lines       10147    10155       +8     
  Branches      545      546       +1     
==========================================
+ Hits         1945     1950       +5     
- Misses       8202     8205       +3     
Flag Coverage Δ
macos_latest 6.74% <0.00%> (-0.01%) ⬇️
ubuntu_latest 19.55% <64.28%> (+0.03%) ⬆️
windows_latest 0.02% <0.00%> (-0.01%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@Krysztal112233
Copy link
Copy Markdown
Collaborator

Krysztal112233 commented Apr 13, 2026

hum, I think you've written the wrong description.

Here's the -e you defined:

SIMPLE PROCESS SELECTION
...
       -e     Select all processes.  Identical to -A.
...

Its description is "Select all processes. Identical to -A.", and I think it's also an alias of -A (maybe? I'm not sure.)

But you wrote "Show the environment after the command.", which is under OUTPUT MODIFIERS:

OUTPUT MODIFIERS
...
       e      Show the environment after the command. <---- HERE
...

@Franklin-Qi
Copy link
Copy Markdown
Contributor Author

Franklin-Qi commented Apr 13, 2026

hum, I think you've written the wrong description.

Here's the -e you defined:

SIMPLE PROCESS SELECTION
...
       -e     Select all processes.  Identical to -A.
...

Its description is "Select all processes. Identical to -A.", and I think it's also an alias of -A (maybe? I'm not sure.)

But you wrote "Show the environment after the command.", which is under OUTPUT MODIFIERS:

OUTPUT MODIFIERS
...
       e      Show the environment after the command. <---- HERE
...

@Krysztal112233 Thank you for your review. I believe you are correct; this is a normal description, and I will make changes.

$  ps --help all 

Usage:
 ps [options]

Basic options:
 -A, -e               all processes
 -a                   all with tty, except session leaders
  a                   all with tty, including other users
 
...

Miscellaneous options:
 -c                   show scheduling class with -l option
  c                   show true command name
  e                   show the environment after command
  
...

        --help <simple|list|output|threads|misc|all>
                      display help and exit

For more details see ps(1).

@Krysztal112233
Copy link
Copy Markdown
Collaborator

you can get all documents from man ps command

@Franklin-Qi
Copy link
Copy Markdown
Contributor Author

Franklin-Qi commented Apr 13, 2026

@Krysztal112233 Thanks, the description here is indeed much clearer.

@Franklin-Qi Franklin-Qi force-pushed the improve-the-parameters-output-of-the-ps-command branch from dc606d1 to c1801fd Compare April 13, 2026 03:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

ps: the parameter output does report errors

2 participants