diff options
| author | Abdellah El Morabit <nsrddyn@gmail.com> | 2025-02-19 11:35:14 +0100 |
|---|---|---|
| committer | Abdellah El Morabit <nsrddyn@gmail.com> | 2025-02-19 11:35:14 +0100 |
| commit | 61359f6e6656a6996c8de3d95c622b65a2a00b3b (patch) | |
| tree | d96f5b0852f60560e47800523bf538bbedc4208f /main.c | |
| parent | e7cf82f0a98d238cf3b6b6fd9a817714fb2cb81a (diff) | |
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
Diffstat (limited to 'main.c')
| -rw-r--r-- | main.c | 10 |
1 files changed, 9 insertions, 1 deletions
@@ -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?/ |
