X-Git-Url: https://git.toastfreeware.priv.at/gregoa/bti.git/blobdiff_plain/c8f56274f6d6f7cb8f7f8a2f002989c396a07042..8a4839e0036c849faf468e8e888e8465c2c4e5ea:/bti.c diff --git a/bti.c b/bti.c index a70443a..9c3b7f4 100644 --- a/bti.c +++ b/bti.c @@ -52,7 +52,7 @@ } while (0) -static int debug; +int debug; static void display_help(void) { @@ -283,6 +283,16 @@ static CURL *curl_init(void) return curl; } +/* The final place data is sent to the screen/pty/tty */ +static void bti_output_line(struct session *session, xmlChar *user, xmlChar *id, + xmlChar *created, xmlChar *text) +{ + if (session->verbose) + printf("[%s] {%s} (%.16s) %s\n", user, id, created, text); + else + printf("[%s] %s\n", user, text); +} + static void parse_statuses(struct session *session, xmlDocPtr doc, xmlNodePtr current) { @@ -314,12 +324,7 @@ static void parse_statuses(struct session *session, } if (user && text && created && id) { - if (session->verbose) - printf("[%s] {%s} (%.16s) %s\n", - user, id, created, text); - else - printf("[%s] %s\n", - user, text); + bti_output_line(session, user, id, created, text); xmlFree(user); xmlFree(text); xmlFree(created);