From: Daniel Cordero Date: Tue, 16 Jun 2009 20:55:02 +0000 (+0059) Subject: Verbose mode shows status IDs X-Git-Url: https://git.toastfreeware.priv.at/gregoa/bti.git/commitdiff_plain/40ccc8d509ab110222bebee5691f490fd82c014e?hp=61fb90945f260856062eacf8185bf959f577e43c Verbose mode shows status IDs --- diff --git a/bti.1 b/bti.1 index 971b3b0..daeed37 100644 --- a/bti.1 +++ b/bti.1 @@ -96,7 +96,7 @@ Performs all steps that would normally be done for a given action, but will not .PP \fB\-\-verbose\fR .RS 4 -Verbose mode +Verbose mode\&. Print status IDs and timestamps\&. .RE .PP \fB\-\-bash\fR diff --git a/bti.c b/bti.c index 4bf6a6c..3987dec 100644 --- a/bti.c +++ b/bti.c @@ -317,6 +317,7 @@ static void parse_statuses(xmlDocPtr doc, xmlNodePtr current) xmlChar *text = NULL; xmlChar *user = NULL; xmlChar *created = NULL; + xmlChar *id = NULL; xmlNodePtr userinfo; current = current->xmlChildrenNode; @@ -326,6 +327,8 @@ static void parse_statuses(xmlDocPtr doc, xmlNodePtr current) created = xmlNodeListGetString(doc, current->xmlChildrenNode, 1); if (!xmlStrcmp(current->name, (const xmlChar *)"text")) text = xmlNodeListGetString(doc, current->xmlChildrenNode, 1); + if (!xmlStrcmp(current->name, (const xmlChar *)"id")) + id = xmlNodeListGetString(doc, current->xmlChildrenNode, 1); if (!xmlStrcmp(current->name, (const xmlChar *)"user")) { userinfo = current->xmlChildrenNode; while (userinfo != NULL) { @@ -338,19 +341,21 @@ static void parse_statuses(xmlDocPtr doc, xmlNodePtr current) } } - if (user && text && created) { + if (user && text && created && id) { if (verbose) - printf("[%s] (%.16s) %s\n", - user, created, text); + printf("[%s] {%s} (%.16s) %s\n", + user, id, created, text); else printf("[%s] %s\n", user, text); xmlFree(user); xmlFree(text); xmlFree(created); + xmlFree(id); user = NULL; text = NULL; created = NULL; + id = NULL; } } current = current->next; diff --git a/bti.xml b/bti.xml index eb93b41..58b9250 100644 --- a/bti.xml +++ b/bti.xml @@ -183,7 +183,7 @@ - Verbose mode + Verbose mode. Print status IDs and timestamps.