diff options
| author | _ov4 <ov4@ov4.org> | 2026-09-01 00:48:48 +0000 |
|---|---|---|
| committer | _ov4 <ov4@ov4.org> | 2026-09-01 00:48:48 +0000 |
| commit | b550c6bb3a0344ba33a00fce126ca571228e3651 (patch) | |
| tree | d3552413822c08e24ff82e0c7420e7573ef50249 /src/command | |
| parent | 5e94ca9f060d2952ef08913234c500a815f734bf (diff) | |
refactor
Diffstat (limited to 'src/command')
| -rw-r--r-- | src/command/bg.cc | 13 | ||||
| -rw-r--r-- | src/command/builtin.cc | 4 | ||||
| -rw-r--r-- | src/command/exit.cc | 11 | ||||
| -rw-r--r-- | src/command/fg.cc | 13 | ||||
| -rw-r--r-- | src/command/jobs.cc | 15 |
5 files changed, 56 insertions, 0 deletions
diff --git a/src/command/bg.cc b/src/command/bg.cc new file mode 100644 index 0000000..06eca45 --- /dev/null +++ b/src/command/bg.cc @@ -0,0 +1,13 @@ +#include "command/builtin.h" + +#include "ground.h" + +namespace ov4::command +{ + +void bg(char **argv) +{ + ov4::do_bgfg(argv); +} + +} diff --git a/src/command/builtin.cc b/src/command/builtin.cc index b2c3149..3e87850 100644 --- a/src/command/builtin.cc +++ b/src/command/builtin.cc @@ -15,6 +15,10 @@ bool exe_bultin_command(char **argv) { if (argv == nullptr || argv[0] == nullptr) exit(1); // WTF??? if (strcmp(argv[0], "quit") == 0) { ov4::command::quit(); return true; } + if (strcmp(argv[0], "exit") == 0) { ov4::command::exit(); return true; } + if (strcmp(argv[0], "jobs") == 0) { ov4::command::jobs(); return true; } + if (strcmp(argv[0], "bg") == 0) { ov4::command::bg(argv); return true; } + if (strcmp(argv[0], "fg") == 0) { ov4::command::fg(argv); return true; } else return false; } diff --git a/src/command/exit.cc b/src/command/exit.cc new file mode 100644 index 0000000..5d817a6 --- /dev/null +++ b/src/command/exit.cc @@ -0,0 +1,11 @@ +#include "command/builtin.h" + +namespace ov4::command +{ + +void exit() +{ + std::exit(0); +} + +} diff --git a/src/command/fg.cc b/src/command/fg.cc new file mode 100644 index 0000000..e2164ee --- /dev/null +++ b/src/command/fg.cc @@ -0,0 +1,13 @@ +#include "command/builtin.h" + +#include "ground.h" + +namespace ov4::command +{ + +void fg(char **argv) +{ + ov4::do_bgfg(argv); +} + +} diff --git a/src/command/jobs.cc b/src/command/jobs.cc new file mode 100644 index 0000000..f618d55 --- /dev/null +++ b/src/command/jobs.cc @@ -0,0 +1,15 @@ +#include "command/builtin.h" + +#include "job.h" + +namespace ov4::command +{ + +using namespace ov4; + +void jobs() +{ + listjobs(ov4::jobs); +} + +} |
