eyeseast / geocode-sqlite

Geocode rows in a SQLite database table
Apache License 2.0
231 stars 6 forks source link

Better argument ergonomics #8

Closed eyeseast closed 3 years ago

eyeseast commented 3 years ago

Looking at this with fresh eyes, this whole bit is dumb:

Note the order of options: There are two sets of options we need to pass.

The first concerns the data we're geocoding. We need to say where our database is and what table we're using, and optionally, how to extract a location query.

Then, we need to say what geocoder we're using, and pass in any options needed to initalize it. This will be different for each geocoder we want to use.

Ideally, it should be something like this:

geocode-sqlite nominatum  data.db data \
 --location="{address}, {city}, {state} {zip}" \
 --delay=1 \
 --user-agent="this-is-me"

Maybe this would be ok:

geocode-sqlite
 --location="{address}, {city}, {state} {zip}" \
 --delay=1 \
 --user-agent="this-is-me" \
nominatum data.db data

But the first way is definitely better.

eyeseast commented 3 years ago

This would probably do a lot to help #2, since doing geocode-sqlite nominatum alone would trigger a help callback.

eyeseast commented 3 years ago

Closed via #9