]> ToastFreeware Gitweb - gregoa/bti.git/blobdiff - bti.c
added bti-shrink-urls.1 to Makefile
[gregoa/bti.git] / bti.c
diff --git a/bti.c b/bti.c
index d0b805419706a4ee5faebd7291db7db05aaa472a..1050e0a076ac16f85549414ea3d8841e75b26ebd 100644 (file)
--- a/bti.c
+++ b/bti.c
@@ -43,7 +43,8 @@
 #define dbg(format, arg...)                                            \
        do {                                                            \
                if (debug)                                              \
-                       printf("%s: " format , __func__ , ## arg);      \
+                       fprintf(stdout, "bti: %s: " format , __func__ , \
+                               ## arg);                                \
        } while (0)
 
 
@@ -103,8 +104,10 @@ static void display_help(void)
        fprintf(stdout, "  --host HOST\n");
        fprintf(stdout, "  --logfile logfile\n");
        fprintf(stdout, "  --shrink-urls\n");
+       fprintf(stdout, "  --page PAGENUMBER\n");
        fprintf(stdout, "  --bash\n");
        fprintf(stdout, "  --debug\n");
+       fprintf(stdout, "  --dry-run\n");
        fprintf(stdout, "  --version\n");
        fprintf(stdout, "  --help\n");
 }
@@ -964,7 +967,7 @@ int main(int argc, char *argv[], char *envp[])
        parse_configfile(session);
 
        while (1) {
-               option = getopt_long_only(argc, argv, "dqe:p:P:H:a:A:u:hg:",
+               option = getopt_long_only(argc, argv, "dqe:p:P:H:a:A:u:hg:sn",
                                          options, NULL);
                if (option == -1)
                        break;
@@ -1050,6 +1053,13 @@ int main(int argc, char *argv[], char *envp[])
                }
        }
 
+       /*
+        * Show the version to make it easier to determine what
+        * is going on here
+        */
+       if (debug)
+               display_version();
+
        if (session->action == ACTION_UNKNOWN) {
                fprintf(stderr, "Unknown action, valid actions are:\n");
                fprintf(stderr, "'update', 'friends', 'public', "
@@ -1082,7 +1092,7 @@ int main(int argc, char *argv[], char *envp[])
 
                session->tweet = zalloc(strlen(tweet) + 10);
                if (session->bash)
-                       sprintf(session->tweet, "$ %s", tweet);
+                       sprintf(session->tweet, "%c %s", getuid() ? '$' : '#', tweet);
                else
                        sprintf(session->tweet, "%s", tweet);