mirror of
https://github.com/RGBCube/serenity
synced 2025-07-27 00:47:45 +00:00
Shell: Resolve aliases in builtin_time
This commit is contained in:
parent
b0ce8d725a
commit
7170df7dd8
1 changed files with 8 additions and 5 deletions
|
@ -698,14 +698,17 @@ int Shell::builtin_time(int argc, const char** argv)
|
||||||
for (auto& arg : args)
|
for (auto& arg : args)
|
||||||
command.argv.append(arg);
|
command.argv.append(arg);
|
||||||
|
|
||||||
|
auto commands = expand_aliases({ move(command) });
|
||||||
|
|
||||||
Core::ElapsedTimer timer;
|
Core::ElapsedTimer timer;
|
||||||
|
int exit_code = 1;
|
||||||
timer.start();
|
timer.start();
|
||||||
auto job = run_command(command);
|
for (auto& job : run_commands(commands)) {
|
||||||
if (!job)
|
|
||||||
return 1;
|
|
||||||
block_on_job(job);
|
block_on_job(job);
|
||||||
|
exit_code = job->exit_code();
|
||||||
|
}
|
||||||
fprintf(stderr, "Time: %d ms\n", timer.elapsed());
|
fprintf(stderr, "Time: %d ms\n", timer.elapsed());
|
||||||
return job->exit_code();
|
return exit_code;
|
||||||
}
|
}
|
||||||
|
|
||||||
int Shell::builtin_umask(int argc, const char** argv)
|
int Shell::builtin_umask(int argc, const char** argv)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue