summaryrefslogtreecommitdiffstats
path: root/src/ft_error.c
blob: 2216eaedd892e1c4b5dd9aa113e843dc57e29387 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
#include <libft.h>
#include <minishell.h>

int
ft_error(const char *com, int errno)
{
	ft_putstr("joe-sh: ");
	ft_putstr(com);
	if (errno == 1)
		ft_putendl(": too many arguments");
	else if (errno == 127)
		ft_putendl(": command not found");
	else if (errno == 255)
		ft_putendl(": numeric argument required");
	return (errno);
}