aboutsummaryrefslogtreecommitdiff
path: root/src/defaultCommands.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/defaultCommands.c')
-rw-r--r--src/defaultCommands.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/defaultCommands.c b/src/defaultCommands.c
index 74415da..533d399 100644
--- a/src/defaultCommands.c
+++ b/src/defaultCommands.c
@@ -1,6 +1,7 @@
#include "commandHandler.h"
#include <stdio.h>
#include <stdlib.h>
+#include <string.h>
void help(char *p_args) {
printf("This is the help message");
@@ -18,6 +19,14 @@ void exitApp(char *p_args) {
exit(EXIT_SUCCESS);
}
+void test(char *p_args) {
+ int i = 0;
+ while (p_args != NULL) {
+ printf("Argument %d: %s\n", i++, p_args);
+ p_args = strtok(NULL, " ");
+ }
+}
+
extern void registerHandler(char *, P_EXECUTOR);
void registerDefaultHandlers() {
@@ -30,4 +39,6 @@ void registerDefaultHandlers() {
registerHandler("v", &version);
registerHandler("exit", &exitApp);
registerHandler("e", &exitApp);
+
+ registerHandler("t", &test);
}