diff options
author | Oleg Zhurakivskyy <oleg.zhurakivskyy@intel.com> | 2011-10-18 14:05:01 +0300 |
---|---|---|
committer | Denis Kenzior <denkenz@gmail.com> | 2011-10-20 12:41:27 -0500 |
commit | 94d1efcf98deb0887bd9bc4d2942218e64f29545 (patch) | |
tree | 692f8b733346bd56e75166174c823d681ccc7197 /tools/lookup-apn.c | |
parent | 646e5c4e84e3f88c8d76295ceadd69dfc47a0d18 (diff) | |
download | ofono-94d1efcf98deb0887bd9bc4d2942218e64f29545.tar.bz2 |
lookup-apn: Add cli option to control duplicates
Diffstat (limited to 'tools/lookup-apn.c')
-rw-r--r-- | tools/lookup-apn.c | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/tools/lookup-apn.c b/tools/lookup-apn.c index c14cced0..83a94bbb 100644 --- a/tools/lookup-apn.c +++ b/tools/lookup-apn.c @@ -34,7 +34,8 @@ #include "plugins/mbpi.h" -static void lookup_apn(const char *match_mcc, const char *match_mnc) +static void lookup_apn(const char *match_mcc, const char *match_mnc, + gboolean allow_duplicates) { GSList *l; GSList *apns; @@ -42,7 +43,7 @@ static void lookup_apn(const char *match_mcc, const char *match_mnc) printf("Searching for info for network: %s%s\n", match_mcc, match_mnc); - apns = mbpi_lookup(match_mcc, match_mnc, TRUE, &error); + apns = mbpi_lookup(match_mcc, match_mnc, allow_duplicates, &error); if (apns == NULL) { if (error != NULL) { @@ -70,10 +71,13 @@ static void lookup_apn(const char *match_mcc, const char *match_mnc) } static gboolean option_version = FALSE; +static gboolean option_duplicates = FALSE; static GOptionEntry options[] = { { "version", 'v', 0, G_OPTION_ARG_NONE, &option_version, "Show version information and exit" }, + { "allow-duplicates", 0, 0, G_OPTION_ARG_NONE, &option_duplicates, + "Allow duplicate access point types" }, { NULL }, }; @@ -106,7 +110,7 @@ int main(int argc, char **argv) exit(1); } - lookup_apn(argv[1], argv[2]); + lookup_apn(argv[1], argv[2], option_duplicates); return 0; } |