Improve printed output

Get rid of inconsistencies in the printed output (error printing,
colors, etc.).

Prepare for user configurable color.

Cleanup.
This commit is contained in:
Martin Lund 2022-02-12 22:47:38 +01:00
parent 5efd519d2e
commit b6eac3f001
8 changed files with 122 additions and 66 deletions

View file

@ -32,10 +32,14 @@ char error[2][1000];
void error_exit(void)
{
/* Always print errors but only print silent errors when in no autoconnect
* mode */
if (error[0][0] != 0)
printf("\rError: %s\r\n", error[0]);
else if ((error[1][0] != 0) && (option.no_autoconnect))
printf("\rError: %s\r\n", error[1]);
if (error[0][0] != 0)
{
/* Print error */
tio_printf("Error: %s", error[0]);
}
else if ((error[1][0] != 0) && (option.no_autoconnect))
{
/* Print silent error */
tio_printf("Error: %s", error[1]);
}
}