From 079d839aee68e52932eacbd8d4c75ba1388b006a Mon Sep 17 00:00:00 2001
From: Rudy Bousset <rbousset@z2r5p6.le-101.fr>
Date: Tue, 29 Oct 2019 13:22:04 +0100
Subject: tons of changes

---
 src/ft_process_arg.c | 22 ++++++++++++++++++++++
 1 file changed, 22 insertions(+)
 create mode 100644 src/ft_process_arg.c

(limited to 'src/ft_process_arg.c')

diff --git a/src/ft_process_arg.c b/src/ft_process_arg.c
new file mode 100644
index 0000000..d82f9da
--- /dev/null
+++ b/src/ft_process_arg.c
@@ -0,0 +1,22 @@
+#include <libft.h>
+#include <minishell.h>
+#include <inttypes.h>
+
+int
+ft_process_arg(const char *arg)
+{
+	char **com;
+	uint8_t i;
+
+	i = 0;
+	com = ft_split(arg, ' ');
+	while (com[i])
+		i++;
+	if (!ft_strncmp(com[0], "exit", ft_strlen(com[0])))
+		return (8);
+	else if (!ft_strncmp(com[0], "echo", ft_strlen(com[0])))
+		ft_echo(com, i);
+	else if (!ft_strncmp(com[0], "pwd", ft_strlen(com[0])))
+		ft_pwd();
+	return (0);
+}
-- 
cgit v1.2.3