feature: added echo cmd

changed printf ref to ft_printf
This commit is contained in:
Tanguy Maze 2019-11-03 00:45:38 +01:00
parent e6304a9f40
commit e89ccb64b2
3 changed files with 10 additions and 5 deletions

View File

@ -6,7 +6,7 @@
/* By: tmaze <tmaze@student.42.fr> +#+ +:+ +#+ */ /* By: tmaze <tmaze@student.42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */ /* +#+#+#+#+#+ +#+ */
/* Created: 2019/09/20 14:42:42 by tmaze #+# #+# */ /* Created: 2019/09/20 14:42:42 by tmaze #+# #+# */
/* Updated: 2019/10/17 10:59:38 by tmaze ### ########.fr */ /* Updated: 2019/11/03 00:39:59 by tmaze ### ########.fr */
/* */ /* */
/* ************************************************************************** */ /* ************************************************************************** */

View File

@ -6,7 +6,7 @@
/* By: tmaze <tmaze@student.42.fr> +#+ +:+ +#+ */ /* By: tmaze <tmaze@student.42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */ /* +#+#+#+#+#+ +#+ */
/* Created: 2019/09/20 14:42:30 by tmaze #+# #+# */ /* Created: 2019/09/20 14:42:30 by tmaze #+# #+# */
/* Updated: 2019/10/17 10:58:52 by tmaze ### ########.fr */ /* Updated: 2019/11/02 23:04:23 by tmaze ### ########.fr */
/* */ /* */
/* ************************************************************************** */ /* ************************************************************************** */
@ -14,7 +14,12 @@
int cmd_echo(char **argv, t_env **env) int cmd_echo(char **argv, t_env **env)
{ {
(void)argv;
(void)env; (void)env;
int i;
i = 1;
while (argv[i])
ft_printf("%s ", argv[i++]);
ft_putchar('\n');
return (0); return (0);
} }

View File

@ -6,7 +6,7 @@
/* By: tmaze <tmaze@student.42.fr> +#+ +:+ +#+ */ /* By: tmaze <tmaze@student.42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */ /* +#+#+#+#+#+ +#+ */
/* Created: 2019/09/20 14:41:08 by tmaze #+# #+# */ /* Created: 2019/09/20 14:41:08 by tmaze #+# #+# */
/* Updated: 2019/10/17 09:59:40 by tmaze ### ########.fr */ /* Updated: 2019/11/02 23:10:32 by tmaze ### ########.fr */
/* */ /* */
/* ************************************************************************** */ /* ************************************************************************** */
@ -28,7 +28,7 @@ int cmd_setenv(char **argv, t_env **env)
} }
else else
{ {
printf("usage: setenv [KEY]=[value]\n"); ft_printf("usage: setenv [KEY]=[value]\n");
return (1); return (1);
} }
} }