debut alias parsing
This commit is contained in:
2
Makefile
2
Makefile
@ -10,7 +10,7 @@
|
|||||||
# #
|
# #
|
||||||
# **************************************************************************** #
|
# **************************************************************************** #
|
||||||
|
|
||||||
CC = cc
|
CC = clang
|
||||||
SRCS_RAW = main.c\
|
SRCS_RAW = main.c\
|
||||||
lst_cmd.c\
|
lst_cmd.c\
|
||||||
cd.c\
|
cd.c\
|
||||||
|
@ -73,6 +73,7 @@ void print_parsed_cmd(t_cmd *cmd);//debug
|
|||||||
void ft_exit(t_cmd *cmd, t_env *env, int error_code);
|
void ft_exit(t_cmd *cmd, t_env *env, int error_code);
|
||||||
char **env_to_char_tab(t_env *env);
|
char **env_to_char_tab(t_env *env);
|
||||||
void handle_minishellrc(t_env *env);
|
void handle_minishellrc(t_env *env);
|
||||||
|
t_cmd *handle_alias(t_cmd *cmd, t_env *env, t_alias *alias);
|
||||||
int cd(t_cmd *args);
|
int cd(t_cmd *args);
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
@ -86,7 +86,7 @@ t_token_type get_token_type(char **command)
|
|||||||
return (res);
|
return (res);
|
||||||
}
|
}
|
||||||
|
|
||||||
t_cmd *parse_command(char *command, t_env *env)
|
t_cmd *parse_command(char *command, t_env *env, t_alis *aliases)
|
||||||
{
|
{
|
||||||
int in_quote;
|
int in_quote;
|
||||||
int in_dquote;
|
int in_dquote;
|
||||||
@ -114,5 +114,6 @@ t_cmd *parse_command(char *command, t_env *env)
|
|||||||
ft_putstr_fd("minishell: syntax error\n", 2);
|
ft_putstr_fd("minishell: syntax error\n", 2);
|
||||||
return (0);
|
return (0);
|
||||||
}
|
}
|
||||||
|
parsed_cmd = handle_alias(parsed_cmd, env, aliases);
|
||||||
return (res);
|
return (res);
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user