- Added color output but forgot to add the sources files, fixed.
- Note: ~ is not expanded in SCYTHERDIR because it is not handled by the shell; thus $HOME should be used.
This commit is contained in:
parent
515dec7f8b
commit
c79c9eb73f
32
src/color.c
Normal file
32
src/color.c
Normal file
@ -0,0 +1,32 @@
|
|||||||
|
/** @file color.c \brief Color output for terminals.
|
||||||
|
*
|
||||||
|
* Depends on the switches (to disable them with a --plain switch)
|
||||||
|
*/
|
||||||
|
|
||||||
|
#include <string.h>
|
||||||
|
#include <stdlib.h>
|
||||||
|
#include <stdio.h>
|
||||||
|
#include "switches.h"
|
||||||
|
|
||||||
|
char *empty = "";
|
||||||
|
char *COLOR_Reset = "[0m";
|
||||||
|
char *COLOR_Red = "[31m";
|
||||||
|
char *COLOR_Green = "[32m";
|
||||||
|
char *COLOR_Bold = "[1m";
|
||||||
|
|
||||||
|
void
|
||||||
|
colorInit (void)
|
||||||
|
{
|
||||||
|
if (switches.plain)
|
||||||
|
{
|
||||||
|
COLOR_Reset = empty;
|
||||||
|
COLOR_Red = empty;
|
||||||
|
COLOR_Green = empty;
|
||||||
|
COLOR_Bold = empty;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
colorDone (void)
|
||||||
|
{
|
||||||
|
}
|
9
src/color.h
Normal file
9
src/color.h
Normal file
@ -0,0 +1,9 @@
|
|||||||
|
#ifndef COLOROUTPUT
|
||||||
|
#define COLOROUTPUT
|
||||||
|
|
||||||
|
extern char *COLOR_Reset;
|
||||||
|
extern char *COLOR_Red;
|
||||||
|
extern char *COLOR_Green;
|
||||||
|
extern char *COLOR_Bold;
|
||||||
|
|
||||||
|
#endif
|
Loading…
Reference in New Issue
Block a user