Leftovers from last commit, accepting account and, password from options
authorAmir Mohammad Saied <amirsaied@gmail.com>
Tue, 27 Jul 2010 16:19:13 +0000 (20:49 +0430)
committerAmir Mohammad Saied <amirsaied@gmail.com>
Tue, 27 Jul 2010 16:19:13 +0000 (20:49 +0430)
bti.c

diff --git a/bti.c b/bti.c
index e2b57c0..8e00935 100644 (file)
--- a/bti.c
+++ b/bti.c
@@ -1270,6 +1270,8 @@ int main(int argc, char *argv[], char *envp[])
        static const struct option options[] = {
                { "debug", 0, NULL, 'd' },
                { "verbose", 0, NULL, 'V' },
+               { "account", 1, NULL, 'a' },
+               { "password", 1, NULL, 'p' },
                { "host", 1, NULL, 'H' },
                { "proxy", 1, NULL, 'P' },
                { "action", 1, NULL, 'A' },
@@ -1340,11 +1342,23 @@ int main(int argc, char *argv[], char *envp[])
                case 'V':
                        verbose = 1;
                        break;
+               case 'a':
+                       if (session->account)
+                               free(session->account);
+                       session->account = strdup(optarg);
+                       dbg("account = %s\n", session->account);
+                       break;
                case 'g':
                        page_nr = atoi(optarg);
                        dbg("page = %d\n", page_nr);
                        session->page = page_nr;
                        break;
+               case 'p':
+                       if (session->password)
+                               free(session->password);
+                       session->password = strdup(optarg);
+                       dbg("password = %s\n", session->password);
+                       break;
                case 'P':
                        if (session->proxy)
                                free(session->proxy);