diff options
author | Mattias Andrée <maandree@kth.se> | 2021-04-05 22:25:05 +0200 |
---|---|---|
committer | Mattias Andrée <maandree@kth.se> | 2021-04-05 22:25:05 +0200 |
commit | b843dec3932b5904af4a019f75d05ba8e0bdf191 (patch) | |
tree | 02868d4f6def9a26dae77dfbd0eaafdc3afe6250 /get-contact-addresses.c | |
parent | Add find-contact-by-address and get-contact-addresses (diff) | |
download | contacts-b843dec3932b5904af4a019f75d05ba8e0bdf191.tar.gz contacts-b843dec3932b5904af4a019f75d05ba8e0bdf191.tar.bz2 contacts-b843dec3932b5904af4a019f75d05ba8e0bdf191.tar.xz |
m + add set-contact-addresses + use -n instead of -l for country
Signed-off-by: Mattias Andrée <maandree@kth.se>
Diffstat (limited to '')
-rw-r--r-- | get-contact-addresses.c | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/get-contact-addresses.c b/get-contact-addresses.c index 89b4707..f936a94 100644 --- a/get-contact-addresses.c +++ b/get-contact-addresses.c @@ -1,21 +1,21 @@ /* See LICENSE file for copyright and license details. */ #include "common.h" -USAGE("[-a address] [-c context] [-g [latitude]:[longitude]] [-l country] " - "[-o care-of] [-p post-code] [-t city] [-ACGLOPT] contact-id ..."); +USAGE("[-a address] [-c context] [-g [latitude]:[longitude]] [-n country] " + "[-o care-of] [-p post-code] [-t city] [-ACGNOPT] contact-id ..."); int main(int argc, char *argv[]) { int fields = 0; - struct passwd *user; - struct libcontacts_contact contact; - struct libcontacts_address **addresses, *addr; char *lookup_addr = NULL, *lookup_ctx = NULL, *lookup_loc = NULL; char *lookup_country = NULL, *lookup_careof = NULL; char *lookup_postcode = NULL, *lookup_city = NULL; double lat, lon, lat_min = 0, lat_max = 0, lon_min = 0, lon_max = 0; + struct passwd *user; + struct libcontacts_contact contact; + struct libcontacts_address **addresses, *addr; int ret = 0, f; size_t i; @@ -45,7 +45,7 @@ main(int argc, char *argv[]) usage(); lookup_city = ARG(); break; - case 'l': + case 'n': if (lookup_country) usage(); lookup_country = ARG(); @@ -54,7 +54,7 @@ main(int argc, char *argv[]) if (lookup_loc) usage(); lookup_loc = ARG(); - if (parse_coord(lookup_loc, &lat_min, &lat_max, &lon_min, &lon_max)) + if (parse_coord(lookup_loc, &lat, &lat_min, &lat_max, &lon, &lon_min, &lon_max)) usage(); break; case 'C': @@ -72,7 +72,7 @@ main(int argc, char *argv[]) case 'T': fields |= 0x10; break; - case 'L': + case 'N': fields |= 0x20; break; case 'G': |