Module Name:    src
Committed By:   lukem
Date:           Fri Nov 29 07:24:04 UTC 2024

Modified Files:
        src/usr.bin/ftp: main.c

Log Message:
ftp: order getopt Upper before lower

Consistently order options in getopt and the switch
with the upper case option before the lower case option.
This makes it easier to cross-reference with -? and ftp(1).
No functional change.


To generate a diff of this commit:
cvs rdiff -u -r1.134 -r1.135 src/usr.bin/ftp/main.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/usr.bin/ftp/main.c
diff -u src/usr.bin/ftp/main.c:1.134 src/usr.bin/ftp/main.c:1.135
--- src/usr.bin/ftp/main.c:1.134	Fri Nov 29 05:40:14 2024
+++ src/usr.bin/ftp/main.c	Fri Nov 29 07:24:04 2024
@@ -1,4 +1,4 @@
-/*	$NetBSD: main.c,v 1.134 2024/11/29 05:40:14 lukem Exp $	*/
+/*	$NetBSD: main.c,v 1.135 2024/11/29 07:24:04 lukem Exp $	*/
 
 /*-
  * Copyright (c) 1996-2024 The NetBSD Foundation, Inc.
@@ -98,7 +98,7 @@ __COPYRIGHT("@(#) Copyright (c) 1985, 19
 #if 0
 static char sccsid[] = "@(#)main.c	8.6 (Berkeley) 10/9/94";
 #else
-__RCSID("$NetBSD: main.c,v 1.134 2024/11/29 05:40:14 lukem Exp $");
+__RCSID("$NetBSD: main.c,v 1.135 2024/11/29 07:24:04 lukem Exp $");
 #endif
 #endif /* not lint */
 
@@ -271,7 +271,7 @@ main(int volatile argc, char **volatile 
 	}
 
 	SLIST_INIT(&custom_headers);
-	while ((ch = getopt(argc, argv, ":46Aab:defgH:inN:o:pP:q:r:Rs:tT:u:vVx:")) != -1) {
+	while ((ch = getopt(argc, argv, ":46Aab:defgH:iN:no:P:pq:Rr:s:T:tu:Vvx:")) != -1) {
 		switch (ch) {
 		case '4':
 			family = AF_INET;
@@ -329,10 +329,6 @@ main(int volatile argc, char **volatile 
 			interactive = 0;
 			break;
 
-		case 'n':
-			autologin = 0;
-			break;
-
 		case 'N':
 			if (strlcpy(netrc, optarg, sizeof(netrc))
 			    >= sizeof(netrc))
@@ -340,45 +336,45 @@ main(int volatile argc, char **volatile 
 				    strerror(ENAMETOOLONG));
 			break;
 
+		case 'n':
+			autologin = 0;
+			break;
+
 		case 'o':
 			outfile = ftp_strdup(optarg);
 			if (strcmp(outfile, "-") == 0)
 				ttyout = stderr;
 			break;
 
+		case 'P':
+			ftpport = optarg;
+			break;
+
 		case 'p':
 			passivemode = 1;
 			activefallback = 0;
 			break;
 
-		case 'P':
-			ftpport = optarg;
-			break;
-
 		case 'q':
 			quit_time = (int)strtol(optarg, &ep, 10);
 			if (quit_time < 1 || *ep != '\0')
 				errx(1, "Bad quit value: %s", optarg);
 			break;
 
+		case 'R':
+			restartautofetch = 1;
+			break;
+
 		case 'r':
 			retry_connect = (int)strtol(optarg, &ep, 10);
 			if (retry_connect < 1 || *ep != '\0')
 				errx(1, "Bad retry value: %s", optarg);
 			break;
 
-		case 'R':
-			restartautofetch = 1;
-			break;
-
 		case 's':
 			src_addr = optarg;
 			break;
 
-		case 't':
-			trace = 1;
-			break;
-
 		case 'T':
 		{
 			int targc;
@@ -408,6 +404,10 @@ main(int volatile argc, char **volatile 
 			break;
 		}
 
+		case 't':
+			trace = 1;
+			break;
+
 		case 'u':
 		{
 			isupload = 1;
@@ -417,14 +417,14 @@ main(int volatile argc, char **volatile 
 			break;
 		}
 
-		case 'v':
-			progress = verbose = 1;
-			break;
-
 		case 'V':
 			progress = verbose = 0;
 			break;
 
+		case 'v':
+			progress = verbose = 1;
+			break;
+
 		case 'x':
 			sndbuf_size = strsuftoi(optarg);
 			if (sndbuf_size < 1)
@@ -1124,10 +1124,10 @@ usage_help(void)
 "  -R            Restart non-proxy auto-fetch\n"
 "  -r RETRY      Retry failed connection attempts after RETRY seconds\n"
 "  -s SRCADDR    Use IP source address SRCADDR\n"
-"  -t            Enable packet tracing\n"
 "  -T DIR,MAX[,INC]\n"
 "                Set maximum transfer rate for direction DIR (all, get, or put)\n"
 "                to MAX bytes/s, with optional increment INC bytes/s\n"
+"  -t            Enable packet tracing\n"
 "  -u URL        URL to upload file arguments to\n"
 "  -V            Disable verbose and progress\n"
 "  -v            Enable verbose and progress\n"

Reply via email to