summary refs log tree commit diff
path: root/notemap.c
diff options
context:
space:
mode:
Diffstat (limited to 'notemap.c')
-rw-r--r--notemap.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/notemap.c b/notemap.c
index e2b41dc..a1d280c 100644
--- a/notemap.c
+++ b/notemap.c
@@ -167,7 +167,7 @@ int main(int argc, char *argv[]) {
 	int rppFlags = 0;
 
 	int opt;
-	while (0 < (opt = getopt(argc, argv, "M:afh:m:p:u:vw"))) {
+	while (0 < (opt = getopt(argc, argv, "M:afh:m:p:vw"))) {
 		switch (opt) {
 			break; case 'M': mailbox = optarg;
 			break; case 'a': add = true;
@@ -181,10 +181,11 @@ int main(int argc, char *argv[]) {
 			break; default:  return EX_USAGE;
 		}
 	}
-	if (!user) errx(EX_USAGE, "username required");
+	if (optind < argc) user = argv[optind++];
 	argv += optind;
 	argc -= optind;
 	
+	if (!user) errx(EX_USAGE, "username required");
 	if (!host) {
 		host = strchr(user, '@');
 		if (!host) errx(EX_USAGE, "no domain in username");