diff options
Diffstat (limited to 'src/ft_process_arg.c')
-rw-r--r-- | src/ft_process_arg.c | 17 |
1 files changed, 4 insertions, 13 deletions
diff --git a/src/ft_process_arg.c b/src/ft_process_arg.c index e1b6f8f..4f6ccf6 100644 --- a/src/ft_process_arg.c +++ b/src/ft_process_arg.c @@ -3,15 +3,6 @@ #include <inttypes.h> int -ft_not_found(const char *com) -{ - ft_putstr("joe-sh: "); - ft_putstr(com); - ft_putendl(": command not found"); - return (127); -} - -int ft_process_arg(const char *arg) { char **com; @@ -24,12 +15,12 @@ ft_process_arg(const char *arg) while (com[i]) i++; if (!ft_strncmp(com[0], "exit", ft_strlen(com[0]))) - return (8); + return (ft_exit(com)); else if (!ft_strncmp(com[0], "echo", ft_strlen(com[0]))) - ft_echo(com, i); + return (ft_echo(com, i)); else if (!ft_strncmp(com[0], "pwd", ft_strlen(com[0]))) - ft_pwd(); + return (ft_pwd()); else - ft_not_found(com[0]); + return (ft_error(com[0]), 127); return (0); } |