Better CLI : colors!
This commit is contained in:
parent
452bb52394
commit
89219f40c6
|
@ -50,6 +50,8 @@
|
||||||
#define C_RESTORE_CURSORPOS "\e8"
|
#define C_RESTORE_CURSORPOS "\e8"
|
||||||
#define C_COLOR_RED "\e[01;31m"
|
#define C_COLOR_RED "\e[01;31m"
|
||||||
#define C_COLOR_YELLOW "\e[01;33m"
|
#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"
|
#define C_COLOR_NORMAL "\e[0m"
|
||||||
|
|
||||||
static char getch(void)
|
static char getch(void)
|
||||||
|
@ -112,7 +114,7 @@ void connectedCommunication(int sockfd)
|
||||||
int curLineLength, curPosition, continueReadLine, answerLength;
|
int curLineLength, curPosition, continueReadLine, answerLength;
|
||||||
|
|
||||||
char *exitCommand = "exit";
|
char *exitCommand = "exit";
|
||||||
char *promptString = "gem-graph console> ";
|
char *promptString = C_COLOR_BLUE "gem-graph console" C_COLOR_NORMAL "> ";
|
||||||
|
|
||||||
for (;;) {
|
for (;;) {
|
||||||
// Zeroing buffer
|
// Zeroing buffer
|
||||||
|
@ -317,7 +319,7 @@ int main(void)
|
||||||
return 2;
|
return 2;
|
||||||
}
|
}
|
||||||
|
|
||||||
printLog("Connected!\n\n");
|
printLog("%sConnected to server!\n\n", C_COLOR_GREEN);
|
||||||
|
|
||||||
connectedCommunication(sockfd);
|
connectedCommunication(sockfd);
|
||||||
|
|
||||||
|
|
|
@ -89,7 +89,8 @@ char *CmdModel(char *buf, char **argv, Server_t *args)
|
||||||
goto CmdModelEnd;
|
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;
|
goto CmdModelEnd;
|
||||||
loadEnd:
|
loadEnd:
|
||||||
// invalid use
|
// invalid use
|
||||||
|
|
Loading…
Reference in New Issue