feat: add some color

This commit is contained in:
iridiumR 2022-09-20 20:26:26 +08:00
parent 72f9204ea6
commit 5c8ed315f7
No known key found for this signature in database
GPG key ID: 5574BE4450D55618
3 changed files with 10 additions and 1 deletions

View file

@ -9,4 +9,12 @@
#define LINE_BUF_SIZE 1024 #define LINE_BUF_SIZE 1024
#define ANSI_COLOR_RED "\x1b[31m"
#define ANSI_COLOR_GREEN "\x1b[32m"
#define ANSI_COLOR_YELLOW "\x1b[33m"
#define ANSI_COLOR_BLUE "\x1b[34m"
#define ANSI_COLOR_MAGENTA "\x1b[35m"
#define ANSI_COLOR_CYAN "\x1b[36m"
#define ANSI_COLOR_RESET "\x1b[0m"
#endif #endif

2
loop.c
View file

@ -17,7 +17,7 @@ int loop() {
char *line; char *line;
char **args; char **args;
printf("> "); printf(ANSI_COLOR_GREEN"> "ANSI_COLOR_RESET);
line = readLine(); line = readLine();
args = splitLine(line); args = splitLine(line);
status = commandExec(args); status = commandExec(args);

1
loop.h
View file

@ -6,5 +6,6 @@
*/ */
#ifndef _LOOP_H_ #ifndef _LOOP_H_
#define _LOOP_H_ #define _LOOP_H_
#include "config.h"
int loop(); int loop();
#endif #endif