-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathmain.c
31 lines (28 loc) · 1.26 KB
/
main.c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* main.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: juligonz <[email protected]> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2020/05/20 13:32:17 by juligonz #+# #+# */
/* Updated: 2020/09/20 18:48:10 by juligonz ### ########.fr */
/* */
/* ************************************************************************** */
#include "minishell.h"
t_shell g_sh;
int main(int ac, const char **av, t_environment envp)
{
g_sh = create_shell(av[0], envp);
set_environment_variable_value("PWD", g_sh.cwd);
if (ac == 1)
{
run_shell();
ft_dprintf(STDERR_FILENO, "exit\n");
}
else
ft_dprintf(STDERR_FILENO,
"minishell: Invalid arguments.\nUsage : ./minishell\n");
destroy_shell(g_sh);
return (g_sh.status);
}