X-Git-Url: http://git.madism.org/?p=apps%2Fmadmutt.git;a=blobdiff_plain;f=main.c;h=cee557dd12f22ecf24312fd3eaa1b5fc2dcb4f05;hp=659d764041c3cc4d2f057ca0306e524f22fa0666;hb=18ea5e8b861632627335b8d94787c742dbf5f567;hpb=96d53ff49c308769efbf708e1e65819077cb7af6 diff --git a/main.c b/main.c index 659d764..cee557d 100644 --- a/main.c +++ b/main.c @@ -25,6 +25,7 @@ #include "url.h" #include "mutt_crypt.h" #include "mutt_idna.h" +#include "xterm.h" #include "lib/mem.h" #include "lib/intl.h" @@ -109,6 +110,7 @@ static void mutt_usage (void) ("usage: muttng [ -nRyzZ ] [ -e ] [ -F ] [ -m ] [ -f ]\n\ muttng [ -nR ] [ -e ] [ -F ] -Q [ -Q ] [...]\n\ muttng [ -nR ] [ -e ] [ -F ] -A [ -A ] [...]\n\ + muttng [ -nR ] [ -e ] [ -F ] -D\n\ muttng [ -nx ] [ -e ] [ -a ] [ -F ] [ -H ] [ -i ] [ -s ] [ -b ] [ -c ] [ ... ]\n\ muttng [ -n ] [ -e ] [ -F ] -p\n\ muttng -v[v]\n\ @@ -118,6 +120,7 @@ options:\n\ -a \tattach a file to the message\n\ -b
\tspecify a blind carbon-copy (BCC) address\n\ -c
\tspecify a carbon-copy (CC) address\n\ + -D\t\tprint the value of all variables to stdout\n\ -e \tspecify a command to be executed after initialization\n\ -f \tspecify which mailbox to read\n\ -F \tspecify an alternate muttrc file\n\ @@ -501,13 +504,12 @@ int main (int argc, char **argv) int version = 0; int i; int explicit_folder = 0; - long sek; + int dump_variables = 0; extern char *optarg; extern int optind; /* initialize random number for tmp file creation */ - time (&sek); - srand (sek); + srand ((unsigned int) time (NULL)); /* sanity check against stupid administrators */ @@ -536,10 +538,10 @@ int main (int argc, char **argv) #ifdef USE_NNTP while ((i = getopt (argc, argv, - "A:a:b:F:f:c:d:e:g:GH:s:i:hm:npQ:RvxyzZ")) != EOF) + "A:a:b:F:f:c:Dd:e:g:GH:s:i:hm:npQ:RvxyzZ")) != EOF) #else while ((i = - getopt (argc, argv, "A:a:b:F:f:c:d:e:H:s:i:hm:npQ:RvxyzZ")) != EOF) + getopt (argc, argv, "A:a:b:F:f:c:Dd:e:H:s:i:hm:npQ:RvxyzZ")) != EOF) #endif switch (i) { case 'A': @@ -584,6 +586,10 @@ int main (int argc, char **argv) #endif break; + case 'D': + dump_variables = 1; + break; + case 'e': commands = mutt_add_list (commands, optarg); break; @@ -673,7 +679,7 @@ int main (int argc, char **argv) } /* Check for a batch send. */ - if (!isatty (0) || queries || alias_queries) { + if (!isatty (0) || queries || alias_queries || dump_variables) { set_option (OPTNOCURSES); sendflags = SENDBATCH; } @@ -693,6 +699,8 @@ int main (int argc, char **argv) if (queries) return mutt_query_variables (queries); + if (dump_variables) + return (mutt_dump_variables ()); if (alias_queries) { int rv = 0; @@ -938,6 +946,8 @@ int main (int argc, char **argv) M_READONLY : 0, NULL)) || !explicit_folder) { mutt_index_menu (); + if (option (OPTXTERMSETTITLES)) + mutt_xterm_set_title (NONULL (XtermLeave)); if (Context) FREE (&Context); }