steve8x8 / geotoad

Geocaching query tool written in Ruby
https://buymeacoffee.com/steve8x8
Other
28 stars 8 forks source link

In format list, overwrite default filename extension (format=ext) #320

Closed steve8x8 closed 8 years ago

steve8x8 commented 9 years ago

With multiple output formats, subsequent output filenames are derived from the possibly given first one by substituting extensions with the defaults set in the template defining the format, e.g.

-x list:gpx:gpx-nuvi:gpx-gsak:gpx-wpts -o $(pwd)/all.list

would overwrite the "lst" default for the first ("list") format but use the default ones for all others. (There's a collision between "gpx" and "gpx-gsak" which may be resolved by overriding the distribution gpx-gsak.tm template file with a self-defined one. This is inviting trouble.)

I'd like to have something like

-x list:gpx:gpx-nuvi:gpx-gsak=gpx2:gpx-wpts -o $(pwd)/all.list

to more transparently replace the default extension for gpx-gsak ("gpx") with "gpx2". No need to copy, modify, and forget (and be skipped by upgrades) own template files anymore, at least not for this purpose.

In short: If there's a "=" in a format name, only the first part will be used to look up the template, and the second part will override the default filename extension defined in that template. This scheme somewhat follows the one adopted for "user found cache lists" (username=filepath).

Comments and suggestions are welcome.

steve8x8 commented 9 years ago

A patch has been merged into git - tests are ongoing

steve8x8 commented 8 years ago

Released with 3.24.0.

Leaving this issue open (although considered resolved) for comments and suggestions.

steve8x8 commented 8 years ago

After 3.25.0 release, closing.