1
0
Fork 0
mirror of https://we.phorge.it/source/arcanist.git synced 2024-11-25 16:22:42 +01:00

Respect --no-ansi and disable ansi for non-TTY terminals.

Summary:

Test Plan:

Reviewers:

CC:
This commit is contained in:
epriestley 2011-02-16 23:41:03 -08:00
parent a3466fcb6d
commit 964030050b

View file

@ -40,12 +40,19 @@ foreach ($args as $key => $arg) {
} else if ($arg == '--trace') { } else if ($arg == '--trace') {
unset($args[$key]); unset($args[$key]);
$config_trace_mode = true; $config_trace_mode = true;
} else if ($arg == '--no-ansi') {
unset($args[$key]);
PhutilConsoleFormatter::disableANSI(true);
} else if (preg_match('/^--load-phutil-library=(.*)$/', $arg, $matches)) { } else if (preg_match('/^--load-phutil-library=(.*)$/', $arg, $matches)) {
unset($args[$key]); unset($args[$key]);
$load['?'] = $matches[1]; $load['?'] = $matches[1];
} }
} }
if (!posix_isatty(STDOUT)) {
PhutilConsoleFormatter::disableANSI(true);
}
$args = array_values($args); $args = array_values($args);
try { try {