\fB\-\-datafile\fP \fI<filename>\fR
Use an alternative addressbook file (default is \fI$HOME/.abook/addressbook\fR).
.TP
-\fB\-\-mutt\-query\fP \fI<string>\fR
+\fB\-\-mutt\-query\fP \fI<string>\fR [ \fB\-\-outformat\fP \fI<outputformat>\fR ]
Make a query for mutt (search the addressbook for \fI<string>\fR).
.br
The \fB\-\-datafile\fP option, as documented above, may be used
.BI BEFORE
this option to search a different addressbook file.
+.br
+Only a subset of the below \fI<outputformat>\fR are allowed: \fBmutt\fP (default), \fBvcard\fP and \fBcustom\fP
.TP
\fB\-\-convert\fP [ \fB\-\-informat\fP \fI<inputformat>\fR ] [ \fB\-\-infile\fP \fI<inputfile>\fR ] [ \fB\-\-outformat\fP \fI<outputformat>\fR ] [ \fB\-\-outfile\fP \fI<outputfile>\fR ]
Converts \fI<inputfile>\fR in \fI<inputformat>\fR to \fI<outputfile>\fR in \fI<outputformat>\fR
- \fBcustom\fP Custom output format, see below
.TP
\fB\-\-outformatstr\fP \fI<string>\fR
-Only used in the context of \fB\-\-mutt\-query\fP \fIand\fR \fB\-\-outformat\fP=\fIcustom\fR. \fI<string>\fR is a format string allowing placeholders.
-A placeholder can be any of the standard fields names (see \fBabookrc\fP(5)) and must be
-encapsulated by curly brackets.
+Only used if \fB\-\-mutt\-query\fP \fIor\fR \fB\-\-convert\fP is specified \fIand\fR \fB\-\-outformat\fP=\fIcustom\fR. \fI<string>\fR is a format string allowing placeholders.
+.br
+A placeholder can be any of the standard fields names (see \fBabookrc\fP(5)) and must be encapsulated by curly brackets.
+.br
The default value is "{nick} ({name}): {mobile}"
-If \fI<string>\fR starts with \fI!\fR only entries whose every fields from \fI<string>\fR are non-NULL are part of the output.
+.br
+If \fI<string>\fR starts with \fI!\fR only entries whose all fields from \fI<string>\fR are non-NULL are included.
.TP
\fB\-\-add-email\fP
Read an e-mail message from stdin and add the sender to the addressbook.
set_convert_var(informat);
break;
case OPT_OUTFORMAT:
+ // ascii-name is stored, it's used to traverse
+ // e_filters[] in MODE_CONVERT (see export_file())
outformat = optarg;
+ // but in case a query-compatible filter is requested
+ // try to guess right now which one it is, from u_filters[]
selected_item_filter = select_output_item_filter(outformat);
break;
case OPT_OUTFORMAT_STR:
}
}
+ // if the output format requested does not allow filtered querying
+ // (not in u_filter[]) and --convert has not been specified; bailout
+ if(! selected_item_filter.func && mode != MODE_CONVERT) {
+ printf("output format %s not supported or incompatible with --mutt-query\n", outformat);
+ exit(EXIT_FAILURE);
+ }
if(! selected_item_filter.func)
selected_item_filter = select_output_item_filter("muttq");
else if (! strcmp(outformat, "custom") && *custom_format) {
*/
void vcard_export_item(FILE *out, int item);
-
+void muttq_print_item(FILE *file, int item);
+void custom_print_item(FILE *out, int item);
/*
* end of function declarations
{
int i;
- puts(_("input:"));
+ puts(_("input formats:"));
for(i=0; *i_filters[i].filtname ; i++)
printf("\t%s\t%s\n", i_filters[i].filtname,
gettext(i_filters[i].desc));
putchar('\n');
- puts(_("output:"));
+ puts(_("output formats:"));
for(i=0; *e_filters[i].filtname ; i++)
printf("\t%s\t%s\n", e_filters[i].filtname,
gettext(e_filters[i].desc));
putchar('\n');
- puts(_("output (with query):"));
+ puts(_("query-compatible output formats:"));
for(i=0; *u_filters[i].filtname ; i++)
printf("\t%s\t%s\n", u_filters[i].filtname,
gettext(u_filters[i].desc));