2007-01-18 [paul] 2.7.1cvs22
authorPaul Mangan <paul@claws-mail.org>
Thu, 18 Jan 2007 09:00:21 +0000 (09:00 +0000)
committerPaul Mangan <paul@claws-mail.org>
Thu, 18 Jan 2007 09:00:21 +0000 (09:00 +0000)
* src/main.c
add command line options:
-h for --help
-q and --quit for --exit
print "Unknown option" for unknown options

ChangeLog
PATCHSETS
configure.ac
src/main.c

index a26180f..c497c37 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,11 @@
+2007-01-18 [paul]      2.7.1cvs22
+
+       * src/main.c
+               add command line options:
+               -h for --help
+               -q and --quit for --exit
+               print "Unknown option" for unknown options
+
 2007-01-18 [paul]      2.7.1cvs21
 
        * po/ru.po
 2007-01-18 [paul]      2.7.1cvs21
 
        * po/ru.po
index c034f42..b61e916 100644 (file)
--- a/PATCHSETS
+++ b/PATCHSETS
 ( cvs diff -u -r 1.1.2.14 -r 1.1.2.15 src/prefs_other.c;  cvs diff -u -r 1.204.2.118 -r 1.204.2.119 src/prefs_common.c;  cvs diff -u -r 1.103.2.74 -r 1.103.2.75 src/prefs_common.h;  cvs diff -u -r 1.115.2.123 -r 1.115.2.124 src/main.c;  ) > 2.7.1cvs19.patchset
 ( cvs diff -u -r 1.274.2.164 -r 1.274.2.165 src/mainwindow.c;  ) > 2.7.1cvs20.patchset
 ( cvs diff -u -r 1.17.2.13 -r 1.17.2.14 po/ru.po;  ) > 2.7.1cvs21.patchset
 ( cvs diff -u -r 1.1.2.14 -r 1.1.2.15 src/prefs_other.c;  cvs diff -u -r 1.204.2.118 -r 1.204.2.119 src/prefs_common.c;  cvs diff -u -r 1.103.2.74 -r 1.103.2.75 src/prefs_common.h;  cvs diff -u -r 1.115.2.123 -r 1.115.2.124 src/main.c;  ) > 2.7.1cvs19.patchset
 ( cvs diff -u -r 1.274.2.164 -r 1.274.2.165 src/mainwindow.c;  ) > 2.7.1cvs20.patchset
 ( cvs diff -u -r 1.17.2.13 -r 1.17.2.14 po/ru.po;  ) > 2.7.1cvs21.patchset
+( cvs diff -u -r 1.115.2.124 -r 1.115.2.125 src/main.c;  ) > 2.7.1cvs22.patchset
index e05f3d5..df36adc 100644 (file)
@@ -11,7 +11,7 @@ MINOR_VERSION=7
 MICRO_VERSION=1
 INTERFACE_AGE=0
 BINARY_AGE=0
 MICRO_VERSION=1
 INTERFACE_AGE=0
 BINARY_AGE=0
-EXTRA_VERSION=21
+EXTRA_VERSION=22
 EXTRA_RELEASE=
 EXTRA_GTK2_VERSION=
 
 EXTRA_RELEASE=
 EXTRA_GTK2_VERSION=
 
index dddc309..3a57e67 100644 (file)
@@ -1030,7 +1030,8 @@ static void parse_cmd_opt(int argc, char *argv[])
                        }
                } else if (!strncmp(argv[i], "--send", 6)) {
                        cmd.send = TRUE;
                        }
                } else if (!strncmp(argv[i], "--send", 6)) {
                        cmd.send = TRUE;
-               } else if (!strncmp(argv[i], "--version", 9)) {
+               } else if (!strncmp(argv[i], "--version", 9) ||
+                          !strncmp(argv[i], "-v", 2)) {
                        puts("Claws Mail version " VERSION);
                        exit(0);
                } else if (!strncmp(argv[i], "--status-full", 13)) {
                        puts("Claws Mail version " VERSION);
                        exit(0);
                } else if (!strncmp(argv[i], "--status-full", 13)) {
@@ -1063,7 +1064,8 @@ static void parse_cmd_opt(int argc, char *argv[])
                        cmd.online_mode = ONLINE_MODE_ONLINE;
                } else if (!strncmp(argv[i], "--offline", 9)) {
                        cmd.online_mode = ONLINE_MODE_OFFLINE;
                        cmd.online_mode = ONLINE_MODE_ONLINE;
                } else if (!strncmp(argv[i], "--offline", 9)) {
                        cmd.online_mode = ONLINE_MODE_OFFLINE;
-               } else if (!strncmp(argv[i], "--help", 6)) {
+               } else if (!strncmp(argv[i], "--help", 6) ||
+                          !strncmp(argv[i], "-h", 2)) {
                        gchar *base = g_path_get_basename(argv[0]);
                        g_print(_("Usage: %s [OPTION]...\n"), base);
 
                        gchar *base = g_path_get_basename(argv[0]);
                        g_print(_("Usage: %s [OPTION]...\n"), base);
 
@@ -1082,10 +1084,10 @@ static void parse_cmd_opt(int argc, char *argv[])
                                          "                         folder is a folder id like 'folder/sub_folder'"));
                        g_print("%s\n", _("  --online               switch to online mode"));
                        g_print("%s\n", _("  --offline              switch to offline mode"));
                                          "                         folder is a folder id like 'folder/sub_folder'"));
                        g_print("%s\n", _("  --online               switch to online mode"));
                        g_print("%s\n", _("  --offline              switch to offline mode"));
-                       g_print("%s\n", _("  --exit                 exit Claws Mail"));
+                       g_print("%s\n", _("  --exit --quit -q       exit Claws Mail"));
                        g_print("%s\n", _("  --debug                debug mode"));
                        g_print("%s\n", _("  --debug                debug mode"));
-                       g_print("%s\n", _("  --help                 display this help and exit"));
-                       g_print("%s\n", _("  --version              output version information and exit"));
+                       g_print("%s\n", _("  --help -h              display this help and exit"));
+                       g_print("%s\n", _("  --version -v           output version information and exit"));
                        g_print("%s\n", _("  --config-dir           output configuration directory"));
 
                        g_free(base);
                        g_print("%s\n", _("  --config-dir           output configuration directory"));
 
                        g_free(base);
@@ -1097,7 +1099,9 @@ static void parse_cmd_opt(int argc, char *argv[])
                } else if (!strncmp(argv[i], "--config-dir", sizeof "--config-dir" - 1)) {
                        puts(RC_DIR);
                        exit(0);
                } else if (!strncmp(argv[i], "--config-dir", sizeof "--config-dir" - 1)) {
                        puts(RC_DIR);
                        exit(0);
-               } else if (!strncmp(argv[i], "--exit", 6)) {
+               } else if (!strncmp(argv[i], "--exit", 6) ||
+                          !strncmp(argv[i], "--quit", 6) ||
+                          !strncmp(argv[i], "-q", 2)) {
                        cmd.exit = TRUE;
                } else if (!strncmp(argv[i], "--select", 8) && i+1 < argc) {
                        cmd.target = argv[i+1];
                        cmd.exit = TRUE;
                } else if (!strncmp(argv[i], "--select", 8) && i+1 < argc) {
                        cmd.target = argv[i+1];
@@ -1121,9 +1125,11 @@ static void parse_cmd_opt(int argc, char *argv[])
                                        cmd.subscribe = TRUE;
                                        cmd.subscribe_uri = p;
                                }
                                        cmd.subscribe = TRUE;
                                        cmd.subscribe_uri = p;
                                }
+                       } else {
+                               g_print(_("Unknown option\n"));
+                               exit(1);
                        }
                }
                        }
                }
-               
        }
 
        if (cmd.attach_files && cmd.compose == FALSE) {
        }
 
        if (cmd.attach_files && cmd.compose == FALSE) {