Improve disabled command line options error messages #120

When using a command line option that must be enabled using
configure flags, display an error message to give a hint that
the given options is not enabled.
This commit is contained in:
Kaian 2016-05-29 12:34:55 +02:00
parent 44b33f3ced
commit 805152b619
1 changed files with 13 additions and 2 deletions

View File

@ -193,10 +193,13 @@ main(int argc, char* argv[])
return 0;
}
break;
#if defined(WITH_GNUTLS) || defined(WITH_OPENSSL)
case 'k':
#if defined(WITH_GNUTLS) || defined(WITH_OPENSSL)
keyfile = optarg;
break;
#else
fprintf(stderr, "sngrep is not compiled with SSL support.");
exit(1);
#endif
case 'c':
only_calls = 1;
@ -228,13 +231,21 @@ main(int argc, char* argv[])
case 't':
case 'W':
break;
#ifdef USE_EEP
case 'L':
#ifdef USE_EEP
capture_eep_set_server_url(optarg);
break;
#else
fprintf(stderr, "sngrep is not compiled with HEP/EEP support.");
exit(1);
#endif
case 'H':
#ifdef USE_EEP
capture_eep_set_client_url(optarg);
break;
#else
fprintf(stderr, "sngrep is not compiled with HEP/EEP support.");
exit(1);
#endif
case '?':
if (strchr(options, optopt)) {