Skip to content

Commit

Permalink
geocode: show Human readable created_at date when doing --index-check
Browse files Browse the repository at this point in the history
  • Loading branch information
jqnatividad committed Dec 31, 2023
1 parent 7cee2f9 commit e2d396d
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions src/cmd/geocode.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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 => {
Expand Down

0 comments on commit e2d396d

Please sign in to comment.