From b77249d2dd051a6765d7abce66b94a06ba8128f7 Mon Sep 17 00:00:00 2001 From: Yuri Astrakhan Date: Mon, 20 Nov 2023 04:41:23 -0500 Subject: [PATCH] Rename dst-type to mbtiles-type --- docs/src/501-martin-cp.md | 2 +- martin/src/bin/martin-cp.rs | 7 ++++++- mbtiles/src/copier.rs | 8 +++++++- tests/test.sh | 6 +++--- 4 files changed, 17 insertions(+), 6 deletions(-) diff --git a/docs/src/501-martin-cp.md b/docs/src/501-martin-cp.md index 10ac7fa8d..a84342069 100644 --- a/docs/src/501-martin-cp.md +++ b/docs/src/501-martin-cp.md @@ -8,7 +8,7 @@ This copies tiles from a PostGIS table `my_table` into an MBTiles file `tileset. ```shell martin-cp --output-file tileset.mbtiles \ - --dst-type normalized \ + --mbtiles-type normalized \ "--bbox=-180,-90,180,90" \ --min-zoom 0 \ --max-zoom 10 \ diff --git a/martin/src/bin/martin-cp.rs b/martin/src/bin/martin-cp.rs index 318cd45a0..d6f16d317 100644 --- a/martin/src/bin/martin-cp.rs +++ b/martin/src/bin/martin-cp.rs @@ -49,7 +49,12 @@ pub struct CopyArgs { #[arg(short, long)] pub output_file: PathBuf, /// Output format of the destination file, ignored if the file exists. For new files, defaults to 'normalized'. - #[arg(long, value_enum)] + #[arg( + long = "mbtiles-type", + alias = "dst-type", + value_name = "SCHEMA", + value_enum + )] pub dst_type: Option, /// Specify the behaviour when generated tile already exists in the destination file. #[arg(long, value_enum, default_value_t = CopyDuplicateMode::default())] diff --git a/mbtiles/src/copier.rs b/mbtiles/src/copier.rs index 20065c682..6640cd199 100644 --- a/mbtiles/src/copier.rs +++ b/mbtiles/src/copier.rs @@ -50,7 +50,13 @@ pub struct MbtilesCopier { /// Output format of the destination file, ignored if the file exists. If not specified, defaults to the type of source #[cfg_attr( feature = "cli", - arg(long = "dst-type", alias = "dst_type", value_enum) + arg( + long = "mbtiles-type", + alias = "dst-type", + alias = "dst_type", + value_name = "SCHEMA", + value_enum + ) )] pub dst_type_cli: Option, /// Destination type with options diff --git a/tests/test.sh b/tests/test.sh index 27436c4ad..8c05cdcb2 100755 --- a/tests/test.sh +++ b/tests/test.sh @@ -385,13 +385,13 @@ if [[ "$MARTIN_CP_BIN" != "-" ]]; then CFG=(--default-srid 900913 --auto-bounds calc tests/fixtures/mbtiles tests/fixtures/pmtiles tests/fixtures/pmtiles2) test_martin_cp "flat" "${CFG[@]}" \ - --source table_source --dst-type flat --concurrency 3 \ + --source table_source --mbtiles-type flat --concurrency 3 \ --min-zoom 0 --max-zoom 8 "--bbox=-2,-1,142.84,45" test_martin_cp "flat-with-hash" "${CFG[@]}" \ - --source table_source --dst-type flat-with-hash --concurrency 3 \ + --source table_source --mbtiles-type flat-with-hash --concurrency 3 \ --min-zoom 0 --max-zoom 8 "--bbox=-2,-1,142.84,45" test_martin_cp "normalized" "${CFG[@]}" \ - --source table_source --dst-type normalized --concurrency 3 \ + --source table_source --mbtiles-type normalized --concurrency 3 \ --min-zoom 0 --max-zoom 8 "--bbox=-2,-1,142.84,45" unset DATABASE_URL