Page MenuHomeFreeBSD

ps: split tree traversal to a separate option
ClosedPublic

Authored by pstef on Jul 29 2023, 7:11 PM.
Tags
None
Referenced Files
Unknown Object (File)
Sun, May 12, 5:28 PM
Unknown Object (File)
Mon, May 6, 8:32 AM
Unknown Object (File)
Sun, May 5, 1:50 PM
Unknown Object (File)
Sat, Apr 27, 2:32 PM
Unknown Object (File)
Mar 11 2024, 4:29 PM
Unknown Object (File)
Mar 11 2024, 4:28 PM
Unknown Object (File)
Mar 8 2024, 2:30 AM
Unknown Object (File)
Mar 8 2024, 2:30 AM

Details

Summary

The first step is to revert ca8c0d5e811048ad67d0955642c5b486e9c0f3d2
Then this feature can be introduced as a separate option "D".
It takes an optional parameter string that can request descension or ascension by containing either '$' or '^' respectively. We can choose other characters if demand appears.
I intend to update the manual page in a later revision.

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

pstef requested review of this revision.Jul 29 2023, 7:11 PM

Your decision is fine to me, but as I mentioned in the email, if your change has been live (in current at least) for a few years, maybe it would cause more problems now to revert it? Especially as the option you chose initially does indeed imply "descendency"

I didn't mean to be such a pain in the wotsit!

For my case, I'd be happy enough if the new proposals for '-d' and '-D' were swapped around -- with '-D' (or whatever you choose) described in the manual page as the PID like grouping and tree structure of "-d" but without any implicit dependency calculations. - so really, just a sorting option.

Or, as I mentioned, maybe an equivalent "ascendancy" option? :-)

It's obviously completely up to you, but I'm willing to contribute to submitting patches etc.

Oh! I should have checked the new patch more closely before posting. I see you've added an ascending option!

I've just confirmed, that your patch (once I add the corresponding "-o" options) allows me to recreate the main functionality of my script with the single command "ps -D'^' -p .... " which is brilliant! - You guessed at my use case before I told you!

Again, as for the option name change, not that I matter, but I don't care if you revert '-d' and add the new option, or continue with your current plan, but I'll feel guilty if you change it back and even more people scream at you :-)

Cheers!

Follow advice from Jamie and use -D up and -D down.

  1. -D doesn't imply -d anymore. I found that to be unnecessarily limiting, now users can decide on the visual format.
  2. The usage output and the manual page are updated.
This revision was not accepted when it landed; it landed in state Needs Review.Aug 24 2023, 4:37 PM
This revision was automatically updated to reflect the committed changes.