2007-01-18 [paul] 2.7.1cvs22
[claws.git] / src / main.c
index 9f1e4d6440c885909561ffd735264211be705ea4..3a57e677361d0df88127cbce645e593c248b8794 100644 (file)
@@ -1,6 +1,6 @@
 /*
  * Sylpheed -- a GTK+ based, lightweight, and fast e-mail client
- * Copyright (C) 1999-2006 Hiroyuki Yamamoto and the Claws Mail team
+ * Copyright (C) 1999-2007 Hiroyuki Yamamoto and the Claws Mail team
  *
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
@@ -157,9 +157,7 @@ static gint lock_socket_remove              (void);
 static void lock_socket_input_cb       (gpointer          data,
                                         gint              source,
                                         GdkInputCondition condition);
-#ifndef CLAWS                                   
-static 
-#endif
+
 gchar *get_socket_name         (void);
 
 
@@ -633,10 +631,6 @@ int main(int argc, char *argv[])
        gtk_accel_map_load (userrc);
        g_free(userrc);
 
-       gtk_settings_set_long_property(gtk_settings_get_default(), 
-                                      "gtk-can-change-accels",
-                                      (glong)TRUE, "XProperty");
-
        CHDIR_RETURN_VAL_IF_FAIL(get_rc_dir(), 1);
 
        MAKE_DIR_IF_NOT_EXIST(get_mail_base_dir());
@@ -680,7 +674,7 @@ int main(int argc, char *argv[])
        gtkaspell_checkers_init();
        prefs_spelling_init();
 #endif
-       
+
        sock_set_io_timeout(prefs_common.io_timeout_secs);
 #ifdef HAVE_LIBETPAN
        imap_main_set_timeout(prefs_common.io_timeout_secs);
@@ -1036,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], "--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)) {
@@ -1069,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;
-               } 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);
 
@@ -1088,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"));
-                       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", _("  --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);
@@ -1103,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], "--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];
@@ -1127,9 +1125,11 @@ static void parse_cmd_opt(int argc, char *argv[])
                                        cmd.subscribe = TRUE;
                                        cmd.subscribe_uri = p;
                                }
+                       } else {
+                               g_print(_("Unknown option\n"));
+                               exit(1);
                        }
                }
-               
        }
 
        if (cmd.attach_files && cmd.compose == FALSE) {
@@ -1271,9 +1271,6 @@ gboolean claws_is_starting(void)
  * CLAWS: want this public so crash dialog can delete the
  * lock file too
  */
-#ifndef CLAWS
-static
-#endif
 gchar *get_socket_name(void)
 {
        static gchar *filename = NULL;