Skip to content

pmap: accept the GNU -XX short option - #838

Merged
sylvestre merged 1 commit into
uutils:mainfrom
emirmrkaljevic:pmap-xx-short
Nov 11, 2026
Merged

sylvestre merged 1 commit into
uutils:mainfrom
emirmrkaljevic:pmap-xx-short

Conversation

@emirmrkaljevic

Copy link
Copy Markdown
Contributor

Fixes #836.

procps-ng uses -XX for the most detailed maps format. On main, pmap -XX <pid> is parsed as -X twice and fails with the argument '-X' cannot be used multiple times. The format was already implemented behind --XX, which GNU does not accept.

clap cannot represent a two-character short flag next to -X, so uumain maps a standalone -XX argument to --XX before parsing. The existing most-extended test now covers both spellings.

I found the mismatch with behave, against GNU procps-ng 4.0.4.

cargo test -j 1 --no-default-features --features sysctl,pmap --test tests, cargo fmt --check, and cargo clippy -j 1 --no-default-features --features sysctl,pmap --all-targets -- -D warnings pass. I skipped the default feature set because uu_top needs libsystemd, which is not installed on this machine.

procps-ng uses -XX for the most detailed maps format. clap cannot
represent a two-character short flag beside -X, so map -XX to the
existing --XX flag before parsing.
@codecov

codecov Bot commented Nov 10, 2026 •

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 88.88889% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 19.99%. Comparing base (67832aa) to head (bdc65ec).
⚠️ Report is 30 commits behind head on main.

Files with missing lines Patch % Lines
src/uu/pmap/src/pmap.rs 0.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #838      +/-   ##
==========================================
+ Coverage   19.20%   19.99%   +0.79%     
==========================================
  Files          68       68              
  Lines       10156    10326     +170     
  Branches      546      552       +6     
==========================================
+ Hits         1950     2065     +115     
- Misses       8206     8261      +55     
Flag Coverage Δ
macos_latest 7.01% <0.00%> (+0.26%) ⬆️
ubuntu_latest 20.36% <88.88%> (+0.80%) ⬆️
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.

@sylvestre
sylvestre merged commit 92dc11d into uutils:main Nov 11, 2026
18 checks passed
@sylvestre

Copy link
Copy Markdown
Contributor

Thanks for your PR

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.

pmap: -XX is rejected as a repeated -X

2 participants