diff options
author | pjd <pjd@FreeBSD.org> | 2005-02-03 21:34:39 +0000 |
---|---|---|
committer | pjd <pjd@FreeBSD.org> | 2005-02-03 21:34:39 +0000 |
commit | 3c0c7b01b6c26ef9bb5936c3196a61eb7ca753e8 (patch) | |
tree | b0d46705962c8a3689f755d811b1af2a4b16e1e1 /sbin | |
parent | 1d320aa5ac237cd841a97d64e773a33612966b5c (diff) | |
download | FreeBSD-src-3c0c7b01b6c26ef9bb5936c3196a61eb7ca753e8.zip FreeBSD-src-3c0c7b01b6c26ef9bb5936c3196a61eb7ca753e8.tar.gz |
- Sort options.
- Put 'break' into separate line.
Diffstat (limited to 'sbin')
-rw-r--r-- | sbin/gbde/gbde.c | 17 |
1 files changed, 9 insertions, 8 deletions
diff --git a/sbin/gbde/gbde.c b/sbin/gbde/gbde.c index a9ab3c2..f2c3c3e 100644 --- a/sbin/gbde/gbde.c +++ b/sbin/gbde/gbde.c @@ -741,7 +741,7 @@ main(int argc, char **argv) } else if (!strcmp(argv[1], "setkey")) { action = ACT_SETKEY; doopen = 1; - opts = "n:l:L:p:P:"; + opts = "l:L:n:p:P:"; } else if (!strcmp(argv[1], "destroy")) { action = ACT_DESTROY; doopen = 1; @@ -749,7 +749,7 @@ main(int argc, char **argv) } else if (!strcmp(argv[1], "nuke")) { action = ACT_NUKE; doopen = 1; - opts = "l:p:n:"; + opts = "l:n:p:"; } else { usage("Unknown sub command\n"); } @@ -781,18 +781,19 @@ main(int argc, char **argv) case 'L': L_opt = optarg; break; + case 'n': + n_opt = strtoul(optarg, &q, 0); + if (!*optarg || *q) + usage("-n argument not numeric\n"); + if (n_opt < -1 || n_opt > G_BDE_MAXKEYS) + usage("-n argument out of range\n"); + break; case 'p': p_opt = optarg; break; case 'P': P_opt = optarg; break; - case 'n': - n_opt = strtoul(optarg, &q, 0); - if (!*optarg || *q) - usage("-n argument not numeric\n"); - if (n_opt < -1 || n_opt > G_BDE_MAXKEYS) - usage("-n argument out of range\n"); break; default: usage("Invalid option\n"); } |