summaryrefslogtreecommitdiffstats
path: root/src/ft_process_arg.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/ft_process_arg.c')
-rw-r--r--src/ft_process_arg.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/src/ft_process_arg.c b/src/ft_process_arg.c
index d82f9da..e1b6f8f 100644
--- a/src/ft_process_arg.c
+++ b/src/ft_process_arg.c
@@ -3,11 +3,22 @@
#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;
uint8_t i;
+ if (arg[0] == '\0')
+ return (0);
i = 0;
com = ft_split(arg, ' ');
while (com[i])
@@ -18,5 +29,7 @@ ft_process_arg(const char *arg)
ft_echo(com, i);
else if (!ft_strncmp(com[0], "pwd", ft_strlen(com[0])))
ft_pwd();
+ else
+ ft_not_found(com[0]);
return (0);
}