utils

small programs, scripts and utils
git clone https://git.e1e0.net/utils.git
Log | Files | Refs

commit f2187f4693a0c48b4470a144a96e413aaf79f702
parent 0ccb6ccebee7f960efaa742a442f950c2ebdf7d5
Author: Paco Esteban <paco@e1e0.net>
Date:   Thu,  6 Aug 2020 16:51:46 +0200

remove `-f` (full) option as I always use it

Diffstat:
Mgeoloc/geoloc.c | 36+++++++++++++-----------------------
1 file changed, 13 insertions(+), 23 deletions(-)

diff --git a/geoloc/geoloc.c b/geoloc/geoloc.c @@ -21,7 +21,7 @@ void usage(void) { (void)fprintf(stderr, - "usage: geoloc [-v] [-f] <ip>\n"); + "usage: geoloc [-v] <ip>\n"); exit(1); } @@ -52,7 +52,6 @@ main(int argc, char *argv[]) { int ch; int f_help = 0; - int f_full = 0; int f_version = 0; int is_v4, is_v6; @@ -91,9 +90,6 @@ main(int argc, char *argv[]) while ((ch = getopt(argc, argv, "fv")) != -1) { switch (ch) { - case 'f': - f_full = 1; - break; case 'v': f_version = 1; break; @@ -177,24 +173,18 @@ main(int argc, char *argv[]) // and print the requested info printf("Requested ip:\t%s\n", json_object_get_string(ip)); - if (f_full == 1) { - printf("Location:\t%s - %s\n", - json_object_get_string(postal), - json_object_get_string(city)); - printf("\t\t%s - %s (%s)\n", - json_object_get_string(region), - json_object_get_string(country_name), - json_object_get_string(continent_code)); - printf("\t\t%s (%s)\n", - json_object_get_string(timezone), - json_object_get_string(utc_offset)); - printf("\t\t%s\n", - json_object_get_string(currency)); - } else { - printf("Country:\t%s (%s)\n", - json_object_get_string(country_name), - json_object_get_string(postal)); - } + printf("Location:\t%s - %s\n", + json_object_get_string(postal), + json_object_get_string(city)); + printf("\t\t%s - %s (%s)\n", + json_object_get_string(region), + json_object_get_string(country_name), + json_object_get_string(continent_code)); + printf("\t\t%s (%s)\n", + json_object_get_string(timezone), + json_object_get_string(utc_offset)); + printf("\t\t%s\n", + json_object_get_string(currency)); printf("Org:\t\t%s (%s)\n", json_object_get_string(org), json_object_get_string(asn)); printf("Coordinates:\t%f, %f\n", json_object_get_double(latitude),