From 61359f6e6656a6996c8de3d95c622b65a2a00b3b Mon Sep 17 00:00:00 2001 From: Abdellah El Morabit Date: Wed, 19 Feb 2025 11:35:14 +0100 Subject: had to update the way the pwd command and the echo command work because of the new code design, echo now has a seperate function and pwd has to take in an argument and then cancel it, this is because of the code structure i commited earlier but instead of making a seperate code structure for every type of command ill just handle it in the commands that dont need it --- main.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'main.c') diff --git a/main.c b/main.c index 1eba34b..5744178 100644 --- a/main.c +++ b/main.c @@ -178,7 +178,15 @@ void clear(const char *arg) { printf("\033[3J"); } -char *print_cdirectory() { +void echo(const char *arg) { + printf("%s", arg); +} + +void print_cdirectory(const char *arg) { + if (arg != NULL) { + printf("print_cdirectory doesn't support any arguments, see help() for help"); + return; + } char *current_working_directory = getcwd(NULL, 0); /* getcwd() command already allocates malloc for the path that should be returned, to do: should I free it when finished or not?/ -- cgit v1.2.3-70-g09d2