Verbose mode shows status IDs
authorDaniel Cordero <theappleman@gmail.com>
Tue, 16 Jun 2009 20:55:02 +0000 (21:54 +0059)
committerDaniel Cordero <theappleman@gmail.com>
Thu, 22 Jul 2010 18:24:44 +0000 (19:24 +0100)
bti.1
bti.c
bti.xml

diff --git a/bti.1 b/bti.1
index 971b3b0..daeed37 100644 (file)
--- 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 (file)
--- 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 (file)
--- a/bti.xml
+++ b/bti.xml
             <term><option>--verbose</option></term>
             <listitem>
               <para>
-                Verbose mode
+                Verbose mode. Print status IDs and timestamps.
               </para>
             </listitem>
           </varlistentry>