/**
 * World map tile CLI
 *
 * Commands:
 *   list            List available Geofabrik region slugs
 *   download:osm    Download a regional .osm.pbf from Geofabrik
 *   download:poly   Download .poly boundary file(s) from Geofabrik
 *   extract         Extract a sub-region from a larger .osm.pbf using osmium
 *   build           Run tilemaker to produce a .pmtiles file
 *   clean           Remove intermediate .osm.pbf and .poly files
 *
 * Usage:
 *   deno task data <command> [options]
 *   deno task data --help
 */

import { Command } from '@cliffy/command'
import { listCmd } from './commands/list.ts'
import { downloadOsmCmd } from './commands/download_osm.ts'
import { downloadPolyCmd } from './commands/download_poly.ts'
import { extractCmd } from './commands/extract.ts'
import { buildCmd } from './commands/build.ts'
import { buildWorldCmd } from './commands/build-world.ts'
import { trimWorldCmd } from './commands/trim-world.ts'
import { updateCmd } from './commands/update.ts'
import { cleanCmd } from './commands/clean.ts'

await new Command()
  .name('world')
  .version('0.1.0')
  .description('CLI tools for generating world map tiles.')
  .action(function () {
    this.showHelp()
  })
  .command('list', listCmd)
  .command('download:osm', downloadOsmCmd)
  .command('download:poly', downloadPolyCmd)
  .command('extract', extractCmd)
  .command('build', buildCmd)
  .command('build:world', buildWorldCmd)
  .command('trim:world', trimWorldCmd)
  .command('update', updateCmd)
  .command('clean', cleanCmd)
  .parse(Deno.args)
