nfc-scan-device: fix option -i
This commit is contained in:
parent
4b97700352
commit
b675db73be
1 changed files with 7 additions and 5 deletions
|
@ -77,11 +77,6 @@ main(int argc, const char *argv[])
|
||||||
bool verbose = false;
|
bool verbose = false;
|
||||||
|
|
||||||
nfc_context *context;
|
nfc_context *context;
|
||||||
nfc_init(&context);
|
|
||||||
|
|
||||||
// Display libnfc version
|
|
||||||
acLibnfcVersion = nfc_version();
|
|
||||||
printf("%s uses libnfc %s\n", argv[0], acLibnfcVersion);
|
|
||||||
|
|
||||||
// Get commandline options
|
// Get commandline options
|
||||||
for (int arg = 1; arg < argc; arg++) {
|
for (int arg = 1; arg < argc; arg++) {
|
||||||
|
@ -91,6 +86,7 @@ main(int argc, const char *argv[])
|
||||||
} else if (0 == strcmp(argv[arg], "-v")) {
|
} else if (0 == strcmp(argv[arg], "-v")) {
|
||||||
verbose = true;
|
verbose = true;
|
||||||
} else if (0 == strcmp(argv[arg], "-i")) {
|
} else if (0 == strcmp(argv[arg], "-i")) {
|
||||||
|
// This has to be done before the call to nfc_init()
|
||||||
setenv("LIBNFC_INTRUSIVE_SCAN", "yes", 1);
|
setenv("LIBNFC_INTRUSIVE_SCAN", "yes", 1);
|
||||||
} else {
|
} else {
|
||||||
ERR("%s is not supported option.", argv[arg]);
|
ERR("%s is not supported option.", argv[arg]);
|
||||||
|
@ -99,6 +95,12 @@ main(int argc, const char *argv[])
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
nfc_init(&context);
|
||||||
|
|
||||||
|
// Display libnfc version
|
||||||
|
acLibnfcVersion = nfc_version();
|
||||||
|
printf("%s uses libnfc %s\n", argv[0], acLibnfcVersion);
|
||||||
|
|
||||||
#ifdef HAVE_LIBUSB
|
#ifdef HAVE_LIBUSB
|
||||||
# ifdef DEBUG
|
# ifdef DEBUG
|
||||||
usb_set_debug(4);
|
usb_set_debug(4);
|
||||||
|
|
Loading…
Reference in a new issue