Better CLI : colors!

This commit is contained in:
Adrien Bourmault 2021-07-14 00:50:07 +02:00
parent 452bb52394
commit 89219f40c6
No known key found for this signature in database
GPG Key ID: 6EB408FE0ACEC664
2 changed files with 6 additions and 3 deletions

View File

@ -50,6 +50,8 @@
#define C_RESTORE_CURSORPOS "\e8"
#define C_COLOR_RED "\e[01;31m"
#define C_COLOR_YELLOW "\e[01;33m"
#define C_COLOR_GREEN "\e[01;32m"
#define C_COLOR_BLUE "\e[01;34m"
#define C_COLOR_NORMAL "\e[0m"
static char getch(void)
@ -112,7 +114,7 @@ void connectedCommunication(int sockfd)
int curLineLength, curPosition, continueReadLine, answerLength;
char *exitCommand = "exit";
char *promptString = "gem-graph console> ";
char *promptString = C_COLOR_BLUE "gem-graph console" C_COLOR_NORMAL "> ";
for (;;) {
// Zeroing buffer
@ -317,7 +319,7 @@ int main(void)
return 2;
}
printLog("Connected!\n\n");
printLog("%sConnected to server!\n\n", C_COLOR_GREEN);
connectedCommunication(sockfd);

View File

@ -89,7 +89,8 @@ char *CmdModel(char *buf, char **argv, Server_t *args)
goto CmdModelEnd;
}
sprintf(buf + strlen(buf), "Model id %d loaded with eid %d\n", id, eid);
sprintf(buf + strlen(buf), "Model id %d loaded with effective "
"id %d\n", id, eid);
goto CmdModelEnd;
loadEnd:
// invalid use