Commit 2019e60
Added support for the '-S/--state' command-line option to filter processes by state.
- Added support for the '-S/--state' command-line option to filter processes by state.
- Implemented validation for the state filter argument (must be one character from "URQWDBPTtZXIS").
- Extended CommandLineSettings struct to include 'stateFilter' field.
- Updated parseArguments() to parse and set 'stateFilter' correctly.
- Copied 'stateFilter' from flags to Settings in CommandLine_run() after argument parsing.
- Applied 'stateFilter' to Settings before UI initialization.
- Ensured proper memory management with free_and_xStrdup for 'stateFilter'.
- Preserved all original logic and flow; no removals of existing code.
Added the stateFilter field to the Settings struct to store the process state filter.
Adiciona checagem de estado conforme `stateFilter`.
Implement filtering by process state (#1544)
- CommandLine.c:
* 57l: Add a Help Flag explaining the new feature
* 82l: Add stateFilter in struct CommandLineSettings_ to store arguments
* 103: Initialize stateFilter as NULL
* 134: Add "state", "S" option in struct option
* 143: Add "-S" argument in looping
* 263: Add case "S" with logic for processing -S flag, ensuring argument is not empty, validate each char against valid process chars
* 425: Add copy for settings and memory management
- Settings.h:
* 113: Add stateFilter pointer to store arguments
- Process.h:
* 59: Declare processStateChar(ProcessState state) in the header for use in valid character identification logic in CommandLine.c
- Process.c:
* 539: Remove static inline from processStateChar to allow use in CommandLine.c
* 862: Add function that filters by state1 parent 744914c commit 2019e60
3 files changed
+54
-3
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
54 | 54 | | |
55 | 55 | | |
56 | 56 | | |
| 57 | + | |
57 | 58 | | |
58 | 59 | | |
59 | 60 | | |
| |||
78 | 79 | | |
79 | 80 | | |
80 | 81 | | |
| 82 | + | |
81 | 83 | | |
82 | 84 | | |
83 | 85 | | |
| |||
98 | 100 | | |
99 | 101 | | |
100 | 102 | | |
| 103 | + | |
101 | 104 | | |
102 | 105 | | |
103 | 106 | | |
| |||
128 | 131 | | |
129 | 132 | | |
130 | 133 | | |
| 134 | + | |
131 | 135 | | |
132 | 136 | | |
133 | 137 | | |
| |||
136 | 140 | | |
137 | 141 | | |
138 | 142 | | |
139 | | - | |
| 143 | + | |
140 | 144 | | |
141 | 145 | | |
142 | 146 | | |
| |||
255 | 259 | | |
256 | 260 | | |
257 | 261 | | |
| 262 | + | |
| 263 | + | |
| 264 | + | |
| 265 | + | |
| 266 | + | |
| 267 | + | |
| 268 | + | |
| 269 | + | |
| 270 | + | |
| 271 | + | |
| 272 | + | |
| 273 | + | |
| 274 | + | |
| 275 | + | |
| 276 | + | |
| 277 | + | |
| 278 | + | |
| 279 | + | |
| 280 | + | |
| 281 | + | |
| 282 | + | |
| 283 | + | |
| 284 | + | |
| 285 | + | |
| 286 | + | |
| 287 | + | |
| 288 | + | |
| 289 | + | |
| 290 | + | |
| 291 | + | |
| 292 | + | |
| 293 | + | |
| 294 | + | |
| 295 | + | |
| 296 | + | |
258 | 297 | | |
259 | 298 | | |
260 | 299 | | |
| |||
382 | 421 | | |
383 | 422 | | |
384 | 423 | | |
| 424 | + | |
| 425 | + | |
| 426 | + | |
385 | 427 | | |
386 | 428 | | |
387 | 429 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
536 | 536 | | |
537 | 537 | | |
538 | 538 | | |
539 | | - | |
| 539 | + | |
540 | 540 | | |
541 | 541 | | |
542 | 542 | | |
| |||
859 | 859 | | |
860 | 860 | | |
861 | 861 | | |
| 862 | + | |
| 863 | + | |
| 864 | + | |
| 865 | + | |
| 866 | + | |
| 867 | + | |
| 868 | + | |
862 | 869 | | |
863 | | - | |
| 870 | + | |
| 871 | + | |
864 | 872 | | |
865 | 873 | | |
866 | 874 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
110 | 110 | | |
111 | 111 | | |
112 | 112 | | |
| 113 | + | |
113 | 114 | | |
114 | 115 | | |
115 | 116 | | |
| |||
0 commit comments