aboutsummaryrefslogtreecommitdiff
path: root/src/command
diff options
context:
space:
mode:
Diffstat (limited to 'src/command')
-rw-r--r--src/command/bg.cc13
-rw-r--r--src/command/builtin.cc4
-rw-r--r--src/command/exit.cc11
-rw-r--r--src/command/fg.cc13
-rw-r--r--src/command/jobs.cc15
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);
+}
+
+}