developer | 4e0da23 | 2022-05-09 13:05:53 +0800 | [diff] [blame] | 1 | --- a/hostapd/main.c |
| 2 | +++ b/hostapd/main.c |
developer | 42b6328 | 2022-06-16 13:33:13 +0800 | [diff] [blame^] | 3 | @@ -31,7 +31,7 @@ |
| 4 | #include "config_file.h" |
| 5 | #include "eap_register.h" |
| 6 | #include "ctrl_iface.h" |
| 7 | - |
| 8 | +#include "build_features.h" |
| 9 | |
| 10 | struct hapd_global { |
| 11 | void **drv_priv; |
| 12 | @@ -692,7 +692,7 @@ int main(int argc, char *argv[]) |
developer | 4e0da23 | 2022-05-09 13:05:53 +0800 | [diff] [blame] | 13 | wpa_supplicant_event = hostapd_wpa_event; |
| 14 | wpa_supplicant_event_global = hostapd_wpa_event_global; |
| 15 | for (;;) { |
developer | 42b6328 | 2022-06-16 13:33:13 +0800 | [diff] [blame^] | 16 | - c = getopt(argc, argv, "b:Bde:f:hi:KP:sSTtu:vg:G:q"); |
| 17 | + c = getopt(argc, argv, "b:Bde:f:hi:KP:sSTtu:g:G:qv::"); |
developer | 4e0da23 | 2022-05-09 13:05:53 +0800 | [diff] [blame] | 18 | if (c < 0) |
| 19 | break; |
| 20 | switch (c) { |
developer | 42b6328 | 2022-06-16 13:33:13 +0800 | [diff] [blame^] | 21 | @@ -729,6 +729,8 @@ int main(int argc, char *argv[]) |
developer | 4e0da23 | 2022-05-09 13:05:53 +0800 | [diff] [blame] | 22 | break; |
| 23 | #endif /* CONFIG_DEBUG_LINUX_TRACING */ |
| 24 | case 'v': |
| 25 | + if (optarg) |
| 26 | + exit(!has_feature(optarg)); |
| 27 | show_version(); |
| 28 | exit(1); |
developer | 42b6328 | 2022-06-16 13:33:13 +0800 | [diff] [blame^] | 29 | case 'g': |
developer | 4e0da23 | 2022-05-09 13:05:53 +0800 | [diff] [blame] | 30 | --- a/wpa_supplicant/main.c |
| 31 | +++ b/wpa_supplicant/main.c |
| 32 | @@ -12,6 +12,7 @@ |
| 33 | #endif /* __linux__ */ |
| 34 | |
| 35 | #include "common.h" |
| 36 | +#include "build_features.h" |
developer | 42b6328 | 2022-06-16 13:33:13 +0800 | [diff] [blame^] | 37 | #include "crypto/crypto.h" |
developer | 4e0da23 | 2022-05-09 13:05:53 +0800 | [diff] [blame] | 38 | #include "fst/fst.h" |
| 39 | #include "wpa_supplicant_i.h" |
developer | 42b6328 | 2022-06-16 13:33:13 +0800 | [diff] [blame^] | 40 | @@ -203,7 +204,7 @@ int main(int argc, char *argv[]) |
developer | 4e0da23 | 2022-05-09 13:05:53 +0800 | [diff] [blame] | 41 | |
| 42 | for (;;) { |
| 43 | c = getopt(argc, argv, |
| 44 | - "b:Bc:C:D:de:f:g:G:hH:i:I:KLMm:No:O:p:P:qsTtuvW"); |
| 45 | + "b:Bc:C:D:de:f:g:G:hH:i:I:KLMm:No:O:p:P:qsTtuv::W"); |
| 46 | if (c < 0) |
| 47 | break; |
| 48 | switch (c) { |
developer | 42b6328 | 2022-06-16 13:33:13 +0800 | [diff] [blame^] | 49 | @@ -306,8 +307,12 @@ int main(int argc, char *argv[]) |
developer | 4e0da23 | 2022-05-09 13:05:53 +0800 | [diff] [blame] | 50 | break; |
| 51 | #endif /* CONFIG_CTRL_IFACE_DBUS_NEW */ |
| 52 | case 'v': |
| 53 | - printf("%s\n", wpa_supplicant_version); |
| 54 | - exitcode = 0; |
| 55 | + if (optarg) { |
| 56 | + exitcode = !has_feature(optarg); |
| 57 | + } else { |
| 58 | + printf("%s\n", wpa_supplicant_version); |
| 59 | + exitcode = 0; |
| 60 | + } |
| 61 | goto out; |
| 62 | case 'W': |
| 63 | params.wait_for_monitor++; |