mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-06-24 03:02:23 +00:00
Shell: Implement AK::Formatter::format() for AST::Command
...and use that to display jobs.
This commit is contained in:
parent
05ff75c321
commit
8de70e8ce7
Notes:
sideshowbarker
2024-07-19 01:42:44 +09:00
Author: https://github.com/alimpfard
Commit: 8de70e8ce7
Pull-request: https://github.com/SerenityOS/serenity/pull/3852
Reviewed-by: https://github.com/asynts
3 changed files with 65 additions and 3 deletions
|
@ -59,15 +59,17 @@ bool Job::print_status(PrintStatusMode mode)
|
|||
if (is_running_in_background())
|
||||
background_indicator = '+';
|
||||
|
||||
const AST::Command& command = *m_command;
|
||||
|
||||
switch (mode) {
|
||||
case PrintStatusMode::Basic:
|
||||
printf("[%" PRIu64 "] %c %s %s\n", m_job_id, background_indicator, status, m_cmd.characters());
|
||||
outln("[{}] {} {} {}", m_job_id, background_indicator, status, command);
|
||||
break;
|
||||
case PrintStatusMode::OnlyPID:
|
||||
printf("[%" PRIu64 "] %c %d %s %s\n", m_job_id, background_indicator, m_pid, status, m_cmd.characters());
|
||||
outln("[{}] {} {} {} {}", m_job_id, background_indicator, m_pid, status, command);
|
||||
break;
|
||||
case PrintStatusMode::ListAll:
|
||||
printf("[%" PRIu64 "] %c %d %d %s %s\n", m_job_id, background_indicator, m_pid, m_pgid, status, m_cmd.characters());
|
||||
outln("[{}] {} {} {} {} {}", m_job_id, background_indicator, m_pid, m_pgid, status, command);
|
||||
break;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue