[PATCH 8/8] agetty: getopt case segment reordering

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



The case clause after getopts is in alphabetical order, just like
option string definition and manual page. The patch also convers
spaces to tabs in this code block.

Signed-off-by: Sami Kerola <kerolasa@xxxxxx>
---
 term-utils/agetty.c |   55 +++++++++++++++++++++++++--------------------------
 1 files changed, 27 insertions(+), 28 deletions(-)

diff --git a/term-utils/agetty.c b/term-utils/agetty.c
index e76eebb..c19a92d 100644
--- a/term-utils/agetty.c
+++ b/term-utils/agetty.c
@@ -387,11 +387,24 @@ parse_args(argc, argv, op)
 
     while ((c = getopt_long(argc, argv, "8cf:hH:iI:l:Lmnst:Uw", longopts, NULL)) != -1) {
 	switch (c) {
+	case '8':
+	    op->eightbits = 1;
+	    break;
 	case 'c':
 	    op->flags |= F_KEEPCFLAGS;
 	    break;
-	case '8':
-	    op->eightbits = 1;
+	case 'f':				/* custom issue file */
+	    op->flags |= F_CUSTISSUE;
+	    op->issue = optarg;
+	    break;
+	case 'h':				/* enable h/w flow control */
+	    op->flags |= F_RTSCTS;
+	    break;
+	case 'H':				/* fake login host */
+	    fakehost = optarg;
+	    break;
+	case 'i':				/* do not show /etc/issue */
+	    op->flags &= ~F_ISSUE;
 	    break;
 	case 'I':
 	    op->initstring = xmalloc(strlen(optarg) + 1);
@@ -429,26 +442,12 @@ parse_args(argc, argv, op)
 	    }
 	    op->flags |= F_INITSTRING;
 	    break;
-
-	case 'L':				/* force local */
- 	    op->flags |= F_LOCAL;
- 	    break;
-	case 'H':                               /* fake login host */
-	    fakehost = optarg;
-	    break;
-	case 'f':				/* custom issue file */
-	    op->flags |= F_CUSTISSUE;
-	    op->issue = optarg;
-	    break;
-	case 'h':				/* enable h/w flow control */
-	    op->flags |= F_RTSCTS;
-	    break;
-	case 'i':				/* do not show /etc/issue */
-	    op->flags &= ~F_ISSUE;
-	    break;
 	case 'l':
 	    op->login = optarg;			/* non-default login program */
 	    break;
+	case 'L':				/* force local */
+	    op->flags |= F_LOCAL;
+	    break;
 	case 'm':				/* parse modem status message */
 	    op->flags |= F_PARSE;
 	    break;
@@ -462,18 +461,18 @@ parse_args(argc, argv, op)
 	    if ((op->timeout = atoi(optarg)) <= 0)
 		error(_("bad timeout value: %s"), optarg);
 	    break;
-	case 'w':
-	    op->flags |= F_WAITCRLF;
-	    break;
 	case 'U':
 	    op->flags |= F_LCUC;
 	    break;
-        case VERSION_OPTION:
-            printf(_("%s from %s\n"), program_invocation_short_name,
-                                      PACKAGE_STRING);
-            exit(EXIT_SUCCESS);
-        case HELP_OPTION:
-            usage(stdout);
+	case 'w':
+	    op->flags |= F_WAITCRLF;
+	    break;
+	case VERSION_OPTION:
+	    printf(_("%s from %s\n"), program_invocation_short_name,
+				      PACKAGE_STRING);
+	    exit(EXIT_SUCCESS);
+	case HELP_OPTION:
+	    usage(stdout);
 	default:
 	    usage(stderr);
 	}
-- 
1.7.4.4

--
To unsubscribe from this list: send the line "unsubscribe util-linux" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Netdev]     [Ethernet Bridging]     [Linux Wireless]     [Kernel Newbies]     [Security]     [Linux for Hams]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux Admin]     [Samba]

  Powered by Linux