Repository navigation
ps: keep a column for a field that has no value yet - #824
jayhemnani9910 wants to merge 2 commits into
Conversation
A format field without a picker (stat, nice, pri, wchan, lstart...) printed its header but no value, so every later value moved one column left: ps -l showed the PID under S and the PPID under UID. Print - for such a field, the mark procps uses for a missing value.
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 #824 +/- ##
==========================================
+ Coverage 19.20% 19.96% +0.76%
==========================================
Files 68 68
Lines 10156 10298 +142
Branches 546 552 +6
==========================================
+ Hits 1950 2056 +106
- Misses 8206 8242 +36
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:
|
| let mut lines = out.lines(); | ||
| let headers = lines.next().unwrap().split_whitespace().count(); | ||
| let values = lines.next().unwrap().split_whitespace().count(); | ||
| assert_eq!(headers, values); |
There was a problem hiding this comment.
maybe also check that the value under PID is 1, not only the count? :)
There was a problem hiding this comment.
Done, the test now finds the PID column and checks that its value is 1.
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. 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.
A format field that ps can't fill yet prints its header but no value, so every value after it moves one column to the left:
The PID shows under
Sand the command underPID.collect_pickersskipped any code without a picker (stat,nice,pri,wchan,lstart,etimes, ...), while the header kept it. Such a field now prints-, which procps-ng also uses for a value it can't show:Filling in those fields is separate work; this only keeps the values under the right headers.
Tests:
test_unimplemented_field_keeps_columns_alignedfails without the change.cargo test: 225 passed (224 on main); clippy clean.