diff options
author | Sami Kerola | 2011-04-10 12:16:15 +0200 |
---|---|---|
committer | Karel Zak | 2011-04-14 13:20:26 +0200 |
commit | 72f286b5f6e84a39d96b915eed426caed460f801 (patch) | |
tree | 516cd6c8d91916d8629761dca7530a553a8677c2 /term-utils/agetty.c | |
parent | docs: agetty long options (diff) | |
download | kernel-qcow2-util-linux-72f286b5f6e84a39d96b915eed426caed460f801.tar.gz kernel-qcow2-util-linux-72f286b5f6e84a39d96b915eed426caed460f801.tar.xz kernel-qcow2-util-linux-72f286b5f6e84a39d96b915eed426caed460f801.zip |
agetty: getopt case segment reordering
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@iki.fi>
Diffstat (limited to 'term-utils/agetty.c')
-rw-r--r-- | 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 f2522614f..9b14276be 100644 --- a/term-utils/agetty.c +++ b/term-utils/agetty.c @@ -386,11 +386,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); @@ -428,26 +441,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; @@ -461,18 +460,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); } |