Repository navigation
ps: leave out the header line when every header is empty - #822
jayhemnani9910 wants to merge 1 commit into
Conversation
ps -o pid= still printed a header row made of spaces, so the first line of output was blank. procps-ng, as its man page says, prints no header line when all column headers are empty.
There was a problem hiding this comment.
Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota.
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 Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #822 +/- ##
==========================================
+ Coverage 19.20% 19.49% +0.29%
==========================================
Files 68 68
Lines 10156 10242 +86
Branches 546 552 +6
==========================================
+ Hits 1950 1997 +47
- Misses 8206 8245 +39
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
ps -o pid=blanks the header, but the header row is still printed, made of spaces:So
ps -o pid= -p "$pid" | head -1, or areadof the first line, gets an empty line. The procps-ng man page: "If all column headers are empty (ps -o pid= -o comm=) then the header line will not be output."uumainnow skips the header row when every mapped header is empty. One named header (-o pid=,ppid) still prints the header line, as in procps-ng. The column padding is unchanged; that is a separate difference.Tests:
test_all_empty_headers_print_no_header_line(-o pid=,-o pid= -o ppid=, and-o pid=,ppidkeeping its header) fails without the change.cargo test --workspace: 225 passed in the main test binary (224 on main), the others unchanged; clippy shows the same 7 warnings as main.