.IR faxcover (1)
program as the sender's company location.
.TP 12
+.BI \-z " filename"
+Read destinations from
+.I filename
+which contains a list of the destinations formatted identically as
+destinations for the
+.B \-d
+option, one per line. Usage of this option is similar to the
+.B \-d
+option and may be done in conjunction with other
+.B \-d
+and
+.B \-z
+options.
+.TP 12
.B \-v
Print information on the standard output
about each conversion and cover sheet
static fxStr dbName;
void addDestination(const char* cp);
+ void addDestinationsFromFile(const char* filename);
void copyToTemporary(int fin, fxStr& tmpl);
void fatal(const char* fmt ...);
void usage();
int verbose = 0;
SendFaxJob& proto = getProtoJob();
db = new FaxDB(tildeExpand(dbName));
- while ((c = Sys::getopt(argc, argv, "a:b:B:c:C:d:f:F:h:i:I:k:M:P:r:s:t:T:U:V:W:x:X:y:Y:12lmnpvwADENR")) != -1)
+ while ((c = Sys::getopt(argc, argv, "a:b:B:c:C:d:f:F:h:i:I:k:M:P:r:s:t:T:U:V:W:x:X:y:Y:z:12lmnpvwADENR")) != -1)
switch (c) {
case '1': // restrict to 1D-encoded data
proto.setDesiredDF(0);
case 'Y': // cover page: sender's location
proto.setCoverFromLocation(optarg);
break;
+ case 'z': // destinations from file
+ addDestinationsFromFile(optarg);
+ break;
case '?':
usage();
/*NOTREACHED*/
}
}
+/*
+ * Add a destinations form file
+ */
+void
+sendFaxApp::addDestinationsFromFile(const char* filename)
+{
+ FILE* destfile;
+ char dest[ 256 ];
+
+ if( ( destfile = fopen( filename, "r" ) ) != NULL )
+ {
+ while( fscanf( destfile, "%255s", dest ) != EOF )
+ {
+ addDestination( dest );
+ }
+ }
+ else
+ {
+ fatal("%s: no such file", filename);
+ }
+}
+
/*
* Copy data from fin to a temporary file.
*/