mirror of
https://github.com/RGBCube/serenity
synced 2025-05-14 08:44:58 +00:00
LibCore: Use Core::Stream
for ProcessStatisticsReader
This commit is contained in:
parent
e338a0656d
commit
8940f2da7f
18 changed files with 55 additions and 95 deletions
|
@ -34,10 +34,7 @@ ErrorOr<int> serenity_main(Main::Arguments args)
|
|||
args_parser.add_positional_argument(pattern, "Process name to search for", "process-name");
|
||||
args_parser.parse(args);
|
||||
|
||||
auto all_processes = Core::ProcessStatisticsReader::get_all();
|
||||
if (!all_processes.has_value()) {
|
||||
return 1;
|
||||
}
|
||||
auto all_processes = TRY(Core::ProcessStatisticsReader::get_all());
|
||||
|
||||
PosixOptions options {};
|
||||
if (case_insensitive) {
|
||||
|
@ -50,7 +47,7 @@ ErrorOr<int> serenity_main(Main::Arguments args)
|
|||
}
|
||||
|
||||
Vector<Core::ProcessStatistics> matched_processes;
|
||||
for (auto& process : all_processes.value().processes) {
|
||||
for (auto& process : all_processes.processes) {
|
||||
auto result = re.match(process.name, PosixFlags::Global);
|
||||
if (result.success) {
|
||||
matched_processes.append(process);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue