diff options
author | Karel Zak | 2012-07-26 09:24:50 +0200 |
---|---|---|
committer | Karel Zak | 2012-07-26 09:24:50 +0200 |
commit | abb7b98ca3ced101627428a90f3c68e3cb3373ff (patch) | |
tree | 0663708114a785fa12e87961964d9a21066c9867 /misc-utils/wipefs.c | |
parent | lsblk: use err_exclusive_options() (diff) | |
download | kernel-qcow2-util-linux-abb7b98ca3ced101627428a90f3c68e3cb3373ff.tar.gz kernel-qcow2-util-linux-abb7b98ca3ced101627428a90f3c68e3cb3373ff.tar.xz kernel-qcow2-util-linux-abb7b98ca3ced101627428a90f3c68e3cb3373ff.zip |
wipefs: use err_exclusive_options()
Signed-off-by: Karel Zak <kzak@redhat.com>
Diffstat (limited to 'misc-utils/wipefs.c')
-rw-r--r-- | misc-utils/wipefs.c | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/misc-utils/wipefs.c b/misc-utils/wipefs.c index f10b5ee4e..cddad8a0e 100644 --- a/misc-utils/wipefs.c +++ b/misc-utils/wipefs.c @@ -383,13 +383,6 @@ main(int argc, char **argv) int c, all = 0, has_offset = 0, noact = 0, quiet = 0; int mode = WP_MODE_PRETTY; - enum { - EXCL_NONE, - EXCL_ALL, - EXCL_OFFSET - }; - int excl_any = EXCL_NONE; - static const struct option longopts[] = { { "all", 0, 0, 'a' }, { "help", 0, 0, 'h' }, @@ -402,15 +395,23 @@ main(int argc, char **argv) { NULL, 0, 0, 0 } }; + static const ul_excl_t excl[] = { /* rows and cols in in ASCII order */ + { 'a','o' }, + { 0 } + }; + int excl_st[ARRAY_SIZE(excl)] = UL_EXCL_STATUS_INIT; + setlocale(LC_ALL, ""); bindtextdomain(PACKAGE, LOCALEDIR); textdomain(PACKAGE); atexit(close_stdout); while ((c = getopt_long(argc, argv, "ahno:pqt:V", longopts, NULL)) != -1) { + + err_exclusive_options(c, longopts, excl, excl_st); + switch(c) { case 'a': - exclusive_option(&excl_any, EXCL_ALL, "--{all,offset}"); all++; break; case 'h': @@ -420,7 +421,6 @@ main(int argc, char **argv) noact++; break; case 'o': - exclusive_option(&excl_any, EXCL_OFFSET, "--{all,offset}"); wp0 = add_offset(wp0, strtosize_or_err(optarg, _("invalid offset argument")), 1); has_offset++; |