From db081ed12d41838e74b4aff1aad1157960b4fbf6 Mon Sep 17 00:00:00 2001 From: iceman1001 Date: Wed, 1 Jul 2020 21:28:02 +0200 Subject: [PATCH] chg: make version printing obey verbose flag --- utils/nfc-list.c | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/utils/nfc-list.c b/utils/nfc-list.c index 9b20517..53dcf61 100644 --- a/utils/nfc-list.c +++ b/utils/nfc-list.c @@ -97,10 +97,6 @@ main(int argc, const char *argv[]) exit(EXIT_FAILURE); } - // Display libnfc version - acLibnfcVersion = nfc_version(); - printf("%s uses libnfc %s\n", argv[0], acLibnfcVersion); - // Get commandline options for (arg = 1; arg < argc; arg++) { if (0 == strcmp(argv[arg], "-h")) { @@ -126,6 +122,13 @@ main(int argc, const char *argv[]) } } + // Display libnfc version + if (verbose) { + acLibnfcVersion = nfc_version(); + printf("%s uses libnfc %s\n", argv[0], acLibnfcVersion); + } + + /* Lazy way to open an NFC device */ #if 0 pnd = nfc_open(context, NULL);