18 .description =
"Change the current working directory.",
19 .usage =
"cd [directory]",
24 .description =
"Show this help message.",
30 .description =
"Clear the terminal screen.",
57 printf(
"\033[33mBUILTINS:\033[0m\n");
63 printf(
"\n\033[33mFEATURES:\033[0m\n");
64 printf(
" command1 | command2\t\033[90mPipe output\033[0m\n");
65 printf(
" command > file \t\033[90mRedirect standard output\033[0m\n");
66 printf(
" command < file \t\033[90mRedirect standard input\033[0m\n");
67 printf(
" command 2> file \t\033[90mRedirect standard error\033[0m\n");
68 printf(
"\n\033[33mKEYBINDINGS:\033[0m\n");
69 printf(
" Back/Left/Right \t\033[90mEdit input\033[0m\n");
70 printf(
" Up/Down \t\033[90mNavigate history\033[0m\n");
71 printf(
" Ctrl+C \t\033[90mTerminate process\033[0m\n");
73 printf(
"\n\033[90mExternal commands are executed from /bin and /usr/bin.\033[0m\n");
static uint64_t builtin_help(uint64_t argc, const char **argv)
uint64_t builtin_execute(uint64_t argc, const char **argv)
static builtin_t builtins[]
static uint64_t builtin_clear(uint64_t argc, const char **argv)
static uint64_t builtin_cd(uint64_t argc, const char **argv)
bool builtin_exists(const char *name)
#define errno
Error number variable.
uint64_t chdir(const char *path)
System call for changing the cwd.
#define ERR
Integer error value.
_PUBLIC int printf(const char *_RESTRICT format,...)
_PUBLIC int fprintf(FILE *_RESTRICT stream, const char *_RESTRICT format,...)
_PUBLIC char * strerror(int errnum)
_PUBLIC int strcmp(const char *s1, const char *s2)
uint64_t(* callback)(uint64_t argc, const char **argv)