mirror of
https://github.com/eosswedenorg/antelope-keygen
synced 2026-06-18 04:00:03 +02:00
console: add disable_color flag.
This commit is contained in:
parent
7bae67ddbc
commit
f1f9eb5a66
5 changed files with 68 additions and 23 deletions
|
|
@ -29,6 +29,10 @@ namespace eoskeygen {
|
|||
namespace console {
|
||||
|
||||
std::ostream& reset(std::ostream& os) {
|
||||
|
||||
if (disable_color) {
|
||||
return os;
|
||||
}
|
||||
return os << "\033[0m";
|
||||
}
|
||||
|
||||
|
|
@ -38,6 +42,10 @@ std::ostream& operator<<(std::ostream& os, const fg& obj) {
|
|||
int attr;
|
||||
int code;
|
||||
|
||||
if (disable_color) {
|
||||
return os;
|
||||
}
|
||||
|
||||
switch(obj._color) {
|
||||
case black : code = 30; break;
|
||||
case red : code = 31; break;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue