Mercurial > pidgin.yaz
comparison src/main.c @ 8596:56360561af5e
[gaim-migrate @ 9347]
" This patch creates a new command line argument ('-c' or
'--config') that allows the location of tha gaim prefs
files to be located somewhere other than in ~/.gaim
The patch also removes the -f argument as it is no
longer relevant since .gaimrc is all but gone.
The one "weirdness" is that for the session managment
support, the --config argument will allways appear to
be specified and will contain either the custom value
(if specified) or the canonical version of ~/.gaim (if
no custom -c is specified). If this should be done
differently, let me know." --Daniel Atallah
committer: Tailor Script <tailor@pidgin.im>
author | Luke Schierer <lschiere@pidgin.im> |
---|---|
date | Tue, 06 Apr 2004 14:29:51 +0000 |
parents | e38c127ec2d4 |
children | cfb11d9a46fd |
comparison
equal
deleted
inserted
replaced
8595:1d5e31e518fc | 8596:56360561af5e |
---|---|
85 GtkWidget *mainwindow = NULL; | 85 GtkWidget *mainwindow = NULL; |
86 | 86 |
87 int opt_away = 0; | 87 int opt_away = 0; |
88 int docklet_count = 0; | 88 int docklet_count = 0; |
89 char *opt_away_arg = NULL; | 89 char *opt_away_arg = NULL; |
90 char *opt_rcfile_arg = NULL; | |
91 int opt_debug = 0; | 90 int opt_debug = 0; |
92 | 91 |
93 #if HAVE_SIGNAL_H | 92 #if HAVE_SIGNAL_H |
94 /* | 93 /* |
95 * Lists of signals we wish to catch and those we wish to ignore. | 94 * Lists of signals we wish to catch and those we wish to ignore. |
528 " name of away message to use)\n" | 527 " name of away message to use)\n" |
529 " -l, --login[=NAME] automatically login (optional argument NAME specifies\n" | 528 " -l, --login[=NAME] automatically login (optional argument NAME specifies\n" |
530 " account(s) to use, seperated by commas)\n" | 529 " account(s) to use, seperated by commas)\n" |
531 " -n, --loginwin don't automatically login; show login window\n" | 530 " -n, --loginwin don't automatically login; show login window\n" |
532 " -u, --user=NAME use account NAME\n" | 531 " -u, --user=NAME use account NAME\n" |
533 " -f, --file=FILE use FILE as config\n" | 532 " -c, --config=DIR use DIR for config files\n" |
534 " -d, --debug print debugging messages to stdout\n" | 533 " -d, --debug print debugging messages to stdout\n" |
535 " -v, --version display the current version and exit\n" | 534 " -v, --version display the current version and exit\n" |
536 " -h, --help display this help and exit\n"), VERSION, name); | 535 " -h, --help display this help and exit\n"), VERSION, name); |
537 break; | 536 break; |
538 case 1: /* short message */ | 537 case 1: /* short message */ |
621 /*{"away", optional_argument, NULL, 'w'}, */ | 620 /*{"away", optional_argument, NULL, 'w'}, */ |
622 {"help", no_argument, NULL, 'h'}, | 621 {"help", no_argument, NULL, 'h'}, |
623 /*{"login", optional_argument, NULL, 'l'}, */ | 622 /*{"login", optional_argument, NULL, 'l'}, */ |
624 {"loginwin", no_argument, NULL, 'n'}, | 623 {"loginwin", no_argument, NULL, 'n'}, |
625 {"user", required_argument, NULL, 'u'}, | 624 {"user", required_argument, NULL, 'u'}, |
626 {"file", required_argument, NULL, 'f'}, | 625 {"config", required_argument, NULL, 'c'}, |
627 {"debug", no_argument, NULL, 'd'}, | 626 {"debug", no_argument, NULL, 'd'}, |
628 {"version", no_argument, NULL, 'v'}, | 627 {"version", no_argument, NULL, 'v'}, |
629 {"session", required_argument, NULL, 's'}, | 628 {"session", required_argument, NULL, 's'}, |
630 {0, 0, 0, 0} | 629 {0, 0, 0, 0} |
631 }; | 630 }; |
756 | 755 |
757 /* scan command-line options */ | 756 /* scan command-line options */ |
758 opterr = 1; | 757 opterr = 1; |
759 while ((opt = getopt_long(argc, argv, | 758 while ((opt = getopt_long(argc, argv, |
760 #ifndef _WIN32 | 759 #ifndef _WIN32 |
761 "adhu:f:vns:", | 760 "adhu:c:vns:", |
762 #else | 761 #else |
763 "adhu:f:vn", | 762 "adhu:c:vn", |
764 #endif | 763 #endif |
765 long_options, NULL)) != -1) { | 764 long_options, NULL)) != -1) { |
766 switch (opt) { | 765 switch (opt) { |
767 case 'u': /* set user */ | 766 case 'u': /* set user */ |
768 opt_user = 1; | 767 opt_user = 1; |
772 opt_acct = 1; | 771 opt_acct = 1; |
773 break; | 772 break; |
774 case 'd': /* debug */ | 773 case 'd': /* debug */ |
775 opt_debug = 1; | 774 opt_debug = 1; |
776 break; | 775 break; |
777 case 'f': | 776 case 'c': /* use specified config dir */ |
778 opt_rcfile_arg = g_strdup(optarg); | 777 set_gaim_user_dir(optarg); |
779 break; | 778 break; |
780 case 's': /* use existing session ID */ | 779 case 's': /* use existing session ID */ |
781 opt_session_arg = g_strdup(optarg); | 780 opt_session_arg = g_strdup(optarg); |
782 break; | 781 break; |
783 case 'v': /* version */ | 782 case 'v': /* version */ |