summaryrefslogtreecommitdiffstats
path: root/misc-utils/uuidgen.c
diff options
context:
space:
mode:
authorKarel Zak2019-04-16 15:14:13 +0200
committerKarel Zak2019-04-16 15:14:13 +0200
commit2c308875a7fa1aaa44892c368f6b37bcfcb8879a (patch)
tree157ea7afca59059676dbcc25133dd196d1e45fb8 /misc-utils/uuidgen.c
parentinclude/c: add print_version() macro (diff)
downloadkernel-qcow2-util-linux-2c308875a7fa1aaa44892c368f6b37bcfcb8879a.tar.gz
kernel-qcow2-util-linux-2c308875a7fa1aaa44892c368f6b37bcfcb8879a.tar.xz
kernel-qcow2-util-linux-2c308875a7fa1aaa44892c368f6b37bcfcb8879a.zip
misc: consolidate version printing and close_stdout()
Signed-off-by: Karel Zak <kzak@redhat.com>
Diffstat (limited to 'misc-utils/uuidgen.c')
-rw-r--r--misc-utils/uuidgen.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/misc-utils/uuidgen.c b/misc-utils/uuidgen.c
index c19706953..fa148abae 100644
--- a/misc-utils/uuidgen.c
+++ b/misc-utils/uuidgen.c
@@ -104,7 +104,7 @@ main (int argc, char *argv[])
setlocale(LC_ALL, "");
bindtextdomain(PACKAGE, LOCALEDIR);
textdomain(PACKAGE);
- atexit(close_stdout);
+ close_stdout_atexit();
while ((c = getopt_long(argc, argv, "rtVhn:N:msx", longopts, NULL)) != -1)
switch (c) {
@@ -114,9 +114,6 @@ main (int argc, char *argv[])
case 'r':
do_type = UUID_TYPE_DCE_RANDOM;
break;
- case 'V':
- printf(UTIL_LINUX_VERSION);
- return EXIT_SUCCESS;
case 'n':
namespace = optarg;
break;
@@ -132,8 +129,11 @@ main (int argc, char *argv[])
case 'x':
is_hex = 1;
break;
+
case 'h':
usage();
+ case 'V':
+ print_version(EXIT_SUCCESS);
default:
errtryhelp(EXIT_FAILURE);
}