Implement filtering by process state (#1544)#1755
Implement filtering by process state (#1544)#1755melrovieira wants to merge 0 commit intohtop-dev:mainfrom
Conversation
BenBE
left a comment
There was a problem hiding this comment.
Why limit this to one state artificially when you are storing a pointer to a string anyway?
The changes of this PR could have been one commit. Please rebase to squash them into one commit.
Also, please write all comments, including commit messages, in English.
| char stateChar = processStateChar(this->state); | ||
| if (stateChar != stateFilter[0]) { | ||
| return true; | ||
| } | ||
| } |
| if (flags.stateFilter) { | ||
| free_and_xStrdup(&settings->stateFilter, flags.stateFilter); | ||
| } |
| break; | ||
| case 'S': | ||
| assert(optarg); | ||
| if (optarg[0] == '\0' || optarg[1] != '\0' || !strchr("URQWDBPTtZXIS", optarg[0])) { |
There was a problem hiding this comment.
The list of valid state characters depends on the platform.
| bool topologyAffinity; | ||
| #endif | ||
|
|
||
| char* stateFilter; |
There was a problem hiding this comment.
I thought the Settings structure is a wrong place for stateFilter. The Settings object is for things that would be saved and loaded in htoprc file, and the filters shouldn't carry across restarts of htop.
|
Somehow indentation in this PR has gotten even worse … |
|
I start to suspect @melrovieira is using an LLM to implement this feature, without full understanding how to code. The commit description of f6d6037 is not helpful. It's useless to give a line-by-line description of changes, as the patch/diff itself can convey the same information. |
|
@Explorer09 Brother, I'm not using LLM, it's just that I've never documented any code, this is my first PR and I don't speak English. But forgive me if I made it seem that way. I tested everything and it's working. I documented poorly because I really don't know how to do it. I'm even using a translator right now. |
|
If you can help me, I appreciate it |
Forgive me for this, I just used the resource that was in the code style guide. |
|
Due to a mishap continued in #1757 … |
PR_HTOP.mp4