add --proxy support to command line
authorGreg Kroah-Hartman <gregkh@suse.de>
Sun, 11 Jan 2009 22:52:19 +0000 (14:52 -0800)
committerGreg Kroah-Hartman <gregkh@suse.de>
Sun, 11 Jan 2009 22:52:19 +0000 (14:52 -0800)
I documented it before I added it...

bti.c

diff --git a/bti.c b/bti.c
index f3fc64c..9d37103 100644 (file)
--- a/bti.c
+++ b/bti.c
@@ -351,6 +351,7 @@ int main(int argc, char *argv[], char *envp[])
                { "account", 1, NULL, 'a' },
                { "password", 1, NULL, 'p' },
                { "host", 1, NULL, 'H' },
+               { "proxy", 1, NULL, 'P' },
                { "help", 0, NULL, 'h' },
                { "bash", 0, NULL, 'b' },
                { "version", 0, NULL, 'v' },
@@ -376,7 +377,7 @@ int main(int argc, char *argv[], char *envp[])
        parse_configfile(session);
 
        while (1) {
-               option = getopt_long_only(argc, argv, "dqe:p:H:a:h",
+               option = getopt_long_only(argc, argv, "dqe:p:P:H:a:h",
                                          options, NULL);
                if (option == -1)
                        break;
@@ -396,6 +397,12 @@ int main(int argc, char *argv[], char *envp[])
                        session->password = strdup(optarg);
                        dbg("password = %s\n", session->password);
                        break;
+               case 'P':
+                       if (session->proxy)
+                               free(session->proxy);
+                       session->proxy = strdup(optarg);
+                       dbg("proxy = %s\n", session->proxy);
+                       break;
                case 'H':
                        if (strcasecmp(optarg, "twitter") == 0)
                                session->host = HOST_TWITTER;