nedmail: add -S parameter for alternate mail service

This commit is contained in:
Russ Cox 2008-07-10 11:08:53 -04:00
parent fd652ac319
commit b2bf14149a

View file

@ -225,7 +225,7 @@ threadmain(int argc, char **argv)
char *err; char *err;
int n, cflag; int n, cflag;
String *prompt; String *prompt;
char *file, *singleton; char *file, *singleton, *service;
Binit(&out, 1, OWRITE); Binit(&out, 1, OWRITE);
@ -233,7 +233,11 @@ threadmain(int argc, char **argv)
singleton = nil; singleton = nil;
reverse = 1; reverse = 1;
cflag = 0; cflag = 0;
service = "mail";
ARGBEGIN { ARGBEGIN {
case 'S':
service = EARGF(usage());
break;
case 'c': case 'c':
cflag = 1; cflag = 1;
break; break;
@ -269,8 +273,8 @@ threadmain(int argc, char **argv)
if(argc) if(argc)
usage(); usage();
if((mailfs = nsmount("mail", nil)) == nil) if((mailfs = nsmount(service, nil)) == nil)
sysfatal("cannot mount mail: %r"); sysfatal("cannot mount %s: %r", service);
switchmb(file, singleton); switchmb(file, singleton);