From 10c4a9af585869da2d26c136c49cc79f2ca45e50 Mon Sep 17 00:00:00 2001 From: "Nathan P. Reiner" Date: Fri, 16 Dec 2022 09:33:11 +0100 Subject: implement wstdf --- smash/builtin.c | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) (limited to 'smash/builtin.c') diff --git a/smash/builtin.c b/smash/builtin.c index 63a4013..a5bbd17 100644 --- a/smash/builtin.c +++ b/smash/builtin.c @@ -4,6 +4,7 @@ #include "../lib/cstr/cstr.h" #include "../lib/sys/io.h" #include "../lib/sys/chdir.h" +#include "../lib/io/io.h" u64 __find_builtin_function_by_name(const char *name); @@ -32,7 +33,7 @@ int __builtin_fn_exit(int argc, const char **argv) int __builtin_fn_cd(int argc, const char **argv) { if (argc != 2) { - write(STDOUT_FD, "path missing\n", 9); + wstd("cd [path]\n"); return -1; } @@ -41,8 +42,14 @@ int __builtin_fn_cd(int argc, const char **argv) int __builtin_fn_help(int argc, const char **argv) { - write(STDOUT_FD, "This is the help page...\n", 25); - write(STDOUT_FD, "TODO: help page\n", 16); + wstdf("%s\n%s\n\n%s\n%s\n\n%s\n", + "Welcome to smash [ \033[1msma\033[0mll \033[1msh\033[0mell ].", + "\033[2mDon't blame me if it doesn't work, it's definitly a skill issue!\033[0m", + "Syntax:", + " command [args] | command [args] | ... | command [args]", + "Author Nathan P. Reiner " + ); + return 0; } -- cgit v1.2.3-70-g09d2