aboutsummaryrefslogtreecommitdiff
path: root/src/util
diff options
context:
space:
mode:
author_ov4 <ov4@ov4.org>2026-09-01 06:21:08 +0000
committer_ov4 <ov4@ov4.org>2026-09-01 06:21:08 +0000
commitc9c3b2f4357e30dd078075b3259d86adca6958e3 (patch)
tree30c826381261333a0f78d87b41e176e148ddd68f /src/util
parentd77e0e13d3624f6210fee3317a5677b2d705a19f (diff)
1
Diffstat (limited to 'src/util')
-rw-r--r--src/util/io.cc30
1 files changed, 30 insertions, 0 deletions
diff --git a/src/util/io.cc b/src/util/io.cc
index 531bd47..1261684 100644
--- a/src/util/io.cc
+++ b/src/util/io.cc
@@ -96,4 +96,34 @@ char *itoa(int num, char* str, int base)
return str;
}
+/*
+ * usage - print a help message
+ */
+void usage(void)
+{
+ printf("Usage: shell [-hvp]\n");
+ printf(" -h print this message\n");
+ printf(" -v print additional diagnostic information\n");
+ printf(" -p do not emit a command prompt\n");
+ exit(1);
+}
+
+/*
+ * unix_error - unix-style error routine
+ */
+void unix_error(char *msg)
+{
+ fprintf(stdout, "%s: %s\n", msg, strerror(errno));
+ exit(1);
+}
+
+/*
+ * app_error - application-style error routine
+ */
+void app_error(char *msg)
+{
+ fprintf(stdout, "%s\n", msg);
+ exit(1);
+}
+
}