dish/loop.c

27 lines
465 B
C
Raw Normal View History

2022-09-18 06:46:23 +00:00
/*
* @Author: 1ridic
* @Date: 2022-09-18 14:13:53
* @Last Modified by: 1ridic
* @Last Modified time: 2022-09-18 23:32:02
2022-09-18 06:46:23 +00:00
*/
#include "loop.h"
#include "exec.h"
#include "line.h"
2022-09-18 05:14:30 +00:00
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
int status;
2022-09-18 05:14:30 +00:00
int loop() {
2022-09-18 05:14:30 +00:00
char *line;
char **args;
2022-09-20 12:26:26 +00:00
printf(ANSI_COLOR_GREEN"> "ANSI_COLOR_RESET);
2022-09-18 05:14:30 +00:00
line = readLine();
args = splitLine(line);
status = commandExec(args);
2022-09-18 05:14:30 +00:00
free(line);
free(args);
return 0;
}