2022-06-19 19:54:09 +02:00
|
|
|
#include "shell.h"
|
|
|
|
#include "lib/stdio.h"
|
|
|
|
#include "lib/string.h"
|
|
|
|
|
|
|
|
int shell_run(char *cmd){
|
2022-06-20 14:17:13 +02:00
|
|
|
int ret = 0;
|
|
|
|
|
|
|
|
puts("\x1b[32m");
|
2022-06-19 19:54:09 +02:00
|
|
|
if(!strcmp(cmd, "HELLO")){
|
|
|
|
printf("Hello!\n");
|
|
|
|
}
|
2022-06-20 14:17:13 +02:00
|
|
|
else if(!strcmp(cmd, "VERSION")){
|
|
|
|
printf("%s\n", OS_VERSION);
|
|
|
|
}
|
2022-06-19 19:54:09 +02:00
|
|
|
else{
|
|
|
|
printf("SHELL: Unknown command \"%s\"\n", cmd);
|
2022-06-20 14:17:13 +02:00
|
|
|
ret = 127;
|
2022-06-19 19:54:09 +02:00
|
|
|
}
|
2022-06-20 14:17:13 +02:00
|
|
|
puts("\x1b[0m");
|
|
|
|
|
|
|
|
return ret;
|
2022-06-19 19:54:09 +02:00
|
|
|
}
|