Controller now disables colors when stdout is no terminal, additionally disables interactive setup when stdin is no terminal.
This commit is contained in:
parent
626e688bf2
commit
8c3178339b
1 changed files with 2 additions and 1 deletions
|
@ -139,7 +139,8 @@ static unsigned long mix(unsigned long a, unsigned long b, unsigned long c){
|
||||||
|
|
||||||
///\brief The main loop for the controller.
|
///\brief The main loop for the controller.
|
||||||
int main_loop(int argc, char **argv){
|
int main_loop(int argc, char **argv){
|
||||||
Controller::isTerminal = Controller::isColorized = isatty(fileno(stdin));
|
Controller::isTerminal = Controller::isColorized = isatty(fileno(stdout));
|
||||||
|
if (!isatty(fileno(stdin))){Controller::isTerminal = false;}
|
||||||
Controller::Storage = JSON::fromFile("config.json");
|
Controller::Storage = JSON::fromFile("config.json");
|
||||||
JSON::Value stored_port =
|
JSON::Value stored_port =
|
||||||
JSON::fromString("{\"long\":\"port\", \"short\":\"p\", \"arg\":\"integer\", \"help\":\"TCP "
|
JSON::fromString("{\"long\":\"port\", \"short\":\"p\", \"arg\":\"integer\", \"help\":\"TCP "
|
||||||
|
|
Loading…
Add table
Reference in a new issue