From e2d396d4bbd3169955684ecb24a1ccc5564b45e4 Mon Sep 17 00:00:00 2001 From: Joel Natividad <1980690+jqnatividad@users.noreply.github.com> Date: Sun, 31 Dec 2023 12:12:54 -0500 Subject: [PATCH] `geocode`: show Human readable created_at date when doing --index-check --- src/cmd/geocode.rs | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/src/cmd/geocode.rs b/src/cmd/geocode.rs index 88472f523..2c4a150d1 100644 --- a/src/cmd/geocode.rs +++ b/src/cmd/geocode.rs @@ -815,19 +815,26 @@ async fn geocode_main(args: Args) -> CliResult<()> { }, }; + let created_at = + util::format_systemtime(metadata.as_ref().unwrap().created_at, "%+"); + eprintln!("Created at: {created_at}"); + match metadata { Some(m) if updater.has_updates(&m).await? => { winfo!( "Updates available at Geonames.org. Use `qsv geocode index-update` to \ update/rebuild the index.\nPlease use this judiciously as Geonames \ - is a free service." + is a free service.\n" ); }, Some(_) => { - winfo!("Geonames index up-to-date."); + winfo!("Geonames index up-to-date.\n"); }, None => return fail_incorrectusage_clierror!("Invalid Geonames index file."), } + + // print to stdout the index metadata as JSON + // so users can redirect stdout to a JSON file if desired println!("{index_metadata_json}"); }, GeocodeSubCmd::IndexUpdate => {