This commit is contained in:
Kinou 2022-03-06 17:43:20 +01:00
parent bb3c586aae
commit 8f391e5c2a
3 changed files with 16 additions and 9 deletions

View File

@ -6,7 +6,7 @@
# By: apommier <apommier@student.42.fr> +#+ +:+ +#+ # # By: apommier <apommier@student.42.fr> +#+ +:+ +#+ #
# +#+#+#+#+#+ +#+ # # +#+#+#+#+#+ +#+ #
# Created: 2022/03/06 12:50:24 by apommier #+# #+# # # Created: 2022/03/06 12:50:24 by apommier #+# #+# #
# Updated: 2022/03/06 16:59:33 by apommier ### ########.fr # # Updated: 2022/03/06 17:29:26 by apommier ### ########.fr #
# # # #
# **************************************************************************** # # **************************************************************************** #
@ -14,7 +14,7 @@
NAME = minishell NAME = minishell
SRCS = main.c SRCS = main.c
OBJS = ${SRCS:.c=.o} OBJS = ${SRCS:.c=.o}
CC = gcc CC = clang
#CFLAGS = -Wall -Wextra #CFLAGS = -Wall -Wextra
LIB = -lreadline LIB = -lreadline
#CFLAGS = -Wall -Wextra -Werror #CFLAGS = -Wall -Wextra -Werror
@ -23,7 +23,7 @@ LIBFT = ./libft
${NAME}: ${OBJS} ${NAME}: ${OBJS}
@make bonus -C ${LIBFT} @make bonus -C ${LIBFT}
@${CC} ${CFLAGS} ${OBJS} ${LIBFT}/libft.a ${LIB} -o ${NAME} @${CC} ${LIB} ${OBJS} ${LIBFT}/libft.a -o ${NAME}
all: ${NAME} bonus all: ${NAME} bonus

13
main.c
View File

@ -6,20 +6,27 @@
/* By: apommier <apommier@student.42.fr> +#+ +:+ +#+ */ /* By: apommier <apommier@student.42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */ /* +#+#+#+#+#+ +#+ */
/* Created: 2022/03/06 13:27:11 by apommier #+# #+# */ /* Created: 2022/03/06 13:27:11 by apommier #+# #+# */
/* Updated: 2022/03/06 17:01:22 by apommier ### ########.fr */ /* Updated: 2022/03/06 17:41:41 by apommier ### ########.fr */
/* */ /* */
/* ************************************************************************** */ /* ************************************************************************** */
#include "minishell.h" #include "minishell.h"
void color()
{
printf("\033[0m");
}
int main(int ac, char **av, char **path) int main(int ac, char **av, char **path)
{ {
char *input; char *input;
printf("---MINISHELL START---\n"); printf("---MINISHELL START---\n");
while (1); while (1)
{ {
input = readline("$-"); color();
input = readline("$~ ");
add_history(input);
} }
return (0); return (0);
} }

View File

@ -43,6 +43,6 @@ typedef struct s_command {
} t_cmd; } t_cmd;
//main.c //main.c
int main(int ac, char **av, char **path); int main();//int ac, char **av, char **path);
#endif #endif