avoid a separate mutt configuration parser in smime_keys.pl.
return 0;
}
+/* Implement the -Q command line flag */
+int mutt_query_variables (LIST *queries)
+{
+ LIST *p;
+
+ char errbuff[STRING];
+ char command[STRING];
+
+ BUFFER err, token;
+
+ memset (&err, 0, sizeof (err));
+ memset (&token, 0, sizeof (token));
+
+ err.data = errbuff;
+ err.dsize = sizeof (errbuff);
+
+ for (p = queries; p; p = p->next)
+ {
+ snprintf (command, sizeof (command), "set ?%s\n", p->data);
+ if (mutt_parse_rc_line (command, &token, &err) == -1)
+ {
+ fprintf (stderr, "%s\n", err.data);
+ FREE (&token.data);
+ return 1;
+ }
+ printf ("%s\n", err.data);
+ }
+
+ FREE (&token.data);
+ return 0;
+}
+
char *mutt_getnamebyvalue (int val, const struct mapping_t *map)
{
int i;
puts _(
"usage: mutt [ -nRyzZ ] [ -e <cmd> ] [ -F <file> ] [ -m <type> ] [ -f <file> ]\n\
+ mutt [ -nR ] [ -e <cmd> ] [ -F <file> ] -Q <query> [ -Q <query> ] [...]
mutt [ -nx ] [ -e <cmd> ] [ -a <file> ] [ -F <file> ] [ -H <file> ] [ -i <file> ] [ -s <subj> ] [ -b <addr> ] [ -c <addr> ] <addr> [ ... ]\n\
mutt [ -n ] [ -e <cmd> ] [ -F <file> ] -p\n\
mutt -v[v]\n\
-m <type>\tspecify a default mailbox type\n\
-n\t\tcauses Mutt not to read the system Muttrc\n\
-p\t\trecall a postponed message\n\
+ -Q <variable>\tquery a configuration variable\n\
-R\t\topen mailbox in read-only mode\n\
-s <subj>\tspecify a subject (must be in quotes if it has spaces)\n\
-v\t\tshow version and compile-time definitions\n\
HEADER *msg = NULL;
LIST *attach = NULL;
LIST *commands = NULL;
+ LIST *queries = NULL;
int sendflags = 0;
int flags = 0;
int version = 0;
memset (Options, 0, sizeof (Options));
memset (QuadOptions, 0, sizeof (QuadOptions));
- while ((i = getopt (argc, argv, "a:b:F:f:c:d:e:H:s:i:hm:npRvxyzZ")) != EOF)
+ while ((i = getopt (argc, argv, "a:b:F:f:c:d:e:H:s:i:hm:npQ:RvxyzZ")) != EOF)
switch (i)
{
case 'a':
sendflags |= SENDPOSTPONED;
break;
+ case 'Q':
+ queries = mutt_add_list (queries, optarg);
+ break;
+
case 'R':
flags |= M_RO; /* read-only mode */
break;
}
/* Check for a batch send. */
- if (!isatty (0))
+ if (!isatty (0) || queries)
{
set_option (OPTNOCURSES);
sendflags = SENDBATCH;
mutt_init (flags & M_NOSYSRC, commands);
mutt_free_list (&commands);
+ if (queries)
+ return mutt_query_variables (queries);
+
if (newMagic)
mx_set_magic (newMagic);
int mutt_pipe_attachment (FILE *, BODY *, const char *, char *);
int mutt_print_attachment (FILE *, BODY *);
int mutt_query_complete (char *, size_t);
+int mutt_query_variables (LIST *queries);
int mutt_save_attachment (FILE *, BODY *, char *, int, HEADER *);
void _mutt_save_message (HEADER *, CONTEXT *, int, int, int);
int mutt_save_message (HEADER *, int, int, int, int *);