Skip to content

ps: select by effective user with -u USER - #870

Open
Harp404 wants to merge 1 commit into
uutils:mainfrom
Harp404:ps-u-user
Open

Harp404 wants to merge 1 commit into
uutils:mainfrom
Harp404:ps-u-user

Conversation

@Harp404

@Harp404 Harp404 commented Dec 1, 2026

Copy link
Copy Markdown

ps -u USER is the common way to list one user's processes, but -u was only a flag for the user format, so the user was rejected:

$ ps -u root -o pid=
error: unexpected argument 'root' found

This resolves the TODO next to -u: it now takes an optional value. -u USER (a name, a UID or a list) selects by effective user, the same as --user USER, and both can be combined. A bare ps -u still prints the user format, as procps-ng does.

The new test test_dash_u_user_selection mirrors test_effective_user_selection for -u. It fails on main and passes with this change, and test_user_format (bare -u) still passes. cargo fmt and cargo clippy --all-targets -- -D warnings are clean.

I used Claude Code (Opus 5.5) to help investigate and draft this change; I reproduced the bug and checked the fix myself.

Copilot AI balanced review requested due to automatic review settings December 1, 2026 09:13

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota. Try requesting a review at a lower effort level.

An organization owner can choose the repository organization as the billing source for reviews requested by members with a paid Copilot license. Learn about Copilot code review billing. Review the Copilot code review billing settings.

@codecov

codecov Bot commented Dec 1, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 41.37931% with 17 lines in your changes missing coverage. Please review.
✅ Project coverage is 20.37%. Comparing base (67832aa) to head (26b6d15).
⚠️ Report is 63 commits behind head on main.

Files with missing lines Patch % Lines
src/uu/ps/src/ps.rs 0.00% 9 Missing ⚠️
src/uu/ps/src/process_selection.rs 0.00% 8 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #870      +/-   ##
==========================================
+ Coverage   19.20%   20.37%   +1.17%     
==========================================
  Files          68       68              
  Lines       10156    10123      -33     
  Branches      546      552       +6     
==========================================
+ Hits         1950     2063     +113     
+ Misses       8206     8060     -146     
Flag Coverage Δ
macos_latest ?
ubuntu_latest 20.78% <41.37%> (+1.23%) ⬆️
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 Harness.
📢 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.

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.

2 participants