Bladeren bron

add -P option to isync wrapper

not really a backwards compat option, but whatever ...

based on a patch submitted long ago by "nobody".
BUG: 1433532
Oswald Buddenhagen 15 jaren geleden
bovenliggende
commit
a8b4de463e
2 gewijzigde bestanden met toevoegingen van 10 en 1 verwijderingen
  1. 3 0
      src/compat/isync.1
  2. 7 1
      src/compat/main.c

+ 3 - 0
src/compat/isync.1

@@ -105,6 +105,9 @@ Specifies the hostname of the IMAP server
 \fB-u\fR, \fB--user\fR \fIuser\fR
 Specifies the login name to access the IMAP server (default: $USER)
 .TP
+\fB-P\fR, \fB--pass\fR \fIpassword\fR
+Specifies the password to access the IMAP server (prompted for by default)
+.TP
 \fB-M\fR, \fB--maildir\fR \fIdir\fR
 Specifies the location for your local mailboxes.
 .TP

+ 7 - 1
src/compat/main.c

@@ -60,6 +60,7 @@ struct option Opts[] = {
 	{"debug", 0, NULL, 'D'},
 	{"quiet", 0, NULL, 'q'},
 	{"user", 1, NULL, 'u'},
+	{"pass", 1, NULL, 'P'},
 	{"version", 0, NULL, 'v'},
 	{"verbose", 0, NULL, 'V'},
 	{0, 0, 0, 0}
@@ -100,6 +101,7 @@ PACKAGE " " VERSION " - mbsync wrapper: IMAP4 to maildir synchronizer\n"
 "  -s, --host HOST	IMAP server address\n"
 "  -p, --port PORT	server IMAP port\n"
 "  -u, --user USER	IMAP user name\n"
+"  -P, --pass PASSWORD	IMAP password\n"
 "  -c, --config CONFIG	read an alternate config file (default: ~/.isyncrc)\n"
 "  -D, --debug		print debugging messages\n"
 "  -V, --verbose		verbose mode (display network traffic)\n"
@@ -182,7 +184,7 @@ main( int argc, char **argv )
 	maildir = "~";
 	xmaildir = Home;
 
-#define FLAGS "wW:alCLRc:defhp:qu:r:F:M:1I:s:vVD"
+#define FLAGS "wW:alCLRc:defhp:qu:P:r:F:M:1I:s:vVD"
 
 	mod = all = list = ops = writeout = Quiet = Verbose = Debug = 0;
 #if HAVE_GETOPT_LONG
@@ -266,6 +268,10 @@ main( int argc, char **argv )
 			global.user = optarg;
 			mod = 1;
 			break;
+		case 'P':
+			global.pass = optarg;
+			mod = 1;
+			break;
 		case 'D':
 			Debug = 1;
 			break;