From aeaa1e070b48781f1cf3d23dad017870c18f4899 Mon Sep 17 00:00:00 2001 From: Yuri Astrakhan Date: Fri, 8 Dec 2023 03:45:37 -0500 Subject: [PATCH] Add extra CLI help string about RUST_LOG (#1053) Improve CLI help screen --- Cargo.lock | 6 +++--- martin/Cargo.toml | 2 +- martin/src/args/root.rs | 6 +++++- martin/src/bin/martin-cp.rs | 3 ++- mbtiles/src/bin/mbtiles.rs | 3 ++- tests/expected/martin-cp/flat-with-hash_metadata.txt | 2 +- tests/expected/martin-cp/flat_metadata.txt | 2 +- tests/expected/martin-cp/normalized_metadata.txt | 2 +- 8 files changed, 16 insertions(+), 10 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 353a514de..2b5ae5eb9 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1845,7 +1845,7 @@ checksum = "b5e6163cb8c49088c2c36f57875e58ccd8c87c7427f7fbd50ea6710b2f3f2e8f" [[package]] name = "martin" -version = "0.11.3" +version = "0.11.4" dependencies = [ "actix-cors", "actix-http", @@ -2841,9 +2841,9 @@ dependencies = [ [[package]] name = "rustix" -version = "0.38.26" +version = "0.38.27" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9470c4bf8246c8daf25f9598dca807fb6510347b1e1cfa55749113850c79d88a" +checksum = "bfeae074e687625746172d639330f1de242a178bf3189b51e35a7a21573513ac" dependencies = [ "bitflags 2.4.1", "errno", diff --git a/martin/Cargo.toml b/martin/Cargo.toml index 6b4987305..ebdf36294 100644 --- a/martin/Cargo.toml +++ b/martin/Cargo.toml @@ -3,7 +3,7 @@ lints.workspace = true [package] name = "martin" # Once the release is published with the hash, update https://github.com/maplibre/homebrew-martin -version = "0.11.3" +version = "0.11.4" authors = ["Stepan Kuzmin ", "Yuri Astrakhan ", "MapLibre contributors"] description = "Blazing fast and lightweight tile server with PostGIS, MBTiles, and PMTiles support" keywords = ["maps", "tiles", "mbtiles", "pmtiles", "postgis"] diff --git a/martin/src/args/root.rs b/martin/src/args/root.rs index a0974cff7..e713b72ea 100644 --- a/martin/src/args/root.rs +++ b/martin/src/args/root.rs @@ -14,7 +14,11 @@ use crate::MartinError::ConfigAndConnectionsError; use crate::{MartinResult, OptOneMany}; #[derive(Parser, Debug, PartialEq, Default)] -#[command(about, version)] +#[command( + about, + version, + after_help = "Use RUST_LOG environment variable to control logging level, e.g. RUST_LOG=debug or RUST_LOG=martin=debug. See https://docs.rs/env_logger/latest/env_logger/index.html#enabling-logging for more information." +)] pub struct Args { #[command(flatten)] pub meta: MetaArgs, diff --git a/martin/src/bin/martin-cp.rs b/martin/src/bin/martin-cp.rs index e05d49d64..e6402320f 100644 --- a/martin/src/bin/martin-cp.rs +++ b/martin/src/bin/martin-cp.rs @@ -36,7 +36,8 @@ const BATCH_SIZE: usize = 1000; #[derive(Parser, Debug, PartialEq, Default)] #[command( about = "A tool to bulk copy tiles from any Martin-supported sources into an mbtiles file", - version + version, + after_help = "Use RUST_LOG environment variable to control logging level, e.g. RUST_LOG=debug or RUST_LOG=martin_cp=debug. See https://docs.rs/env_logger/latest/env_logger/index.html#enabling-logging for more information." )] pub struct CopierArgs { #[command(flatten)] diff --git a/mbtiles/src/bin/mbtiles.rs b/mbtiles/src/bin/mbtiles.rs index 551792f74..6d7abc216 100644 --- a/mbtiles/src/bin/mbtiles.rs +++ b/mbtiles/src/bin/mbtiles.rs @@ -8,7 +8,8 @@ use mbtiles::{apply_patch, AggHashType, IntegrityCheckType, MbtResult, Mbtiles, #[command( version, name = "mbtiles", - about = "A utility to work with .mbtiles file content" + about = "A utility to work with .mbtiles file content", + after_help = "Use RUST_LOG environment variable to control logging level, e.g. RUST_LOG=debug or RUST_LOG=mbtiles=debug. See https://docs.rs/env_logger/latest/env_logger/index.html#enabling-logging for more information." )] pub struct Args { /// Display detailed information diff --git a/tests/expected/martin-cp/flat-with-hash_metadata.txt b/tests/expected/martin-cp/flat-with-hash_metadata.txt index 871bb20ba..f6350e5e3 100644 --- a/tests/expected/martin-cp/flat-with-hash_metadata.txt +++ b/tests/expected/martin-cp/flat-with-hash_metadata.txt @@ -9,6 +9,6 @@ tilejson: description: public.function_zxy_query_test name: function_zxy_query_test format: mvt - generator: martin-cp v0.11.3 + generator: martin-cp v0.11.4 agg_tiles_hash: 9B931A386D6075D1DA55323BD4DBEDAE diff --git a/tests/expected/martin-cp/flat_metadata.txt b/tests/expected/martin-cp/flat_metadata.txt index 2be446cee..3113d6d3b 100644 --- a/tests/expected/martin-cp/flat_metadata.txt +++ b/tests/expected/martin-cp/flat_metadata.txt @@ -18,6 +18,6 @@ tilejson: name: table_source foo: '{"bar":"foo"}' format: mvt - generator: martin-cp v0.11.3 + generator: martin-cp v0.11.4 agg_tiles_hash: EF19FCBCE73ADE1C85E856E6BBA9B4C7 diff --git a/tests/expected/martin-cp/normalized_metadata.txt b/tests/expected/martin-cp/normalized_metadata.txt index eaa78cd9b..4ff912068 100644 --- a/tests/expected/martin-cp/normalized_metadata.txt +++ b/tests/expected/martin-cp/normalized_metadata.txt @@ -35,6 +35,6 @@ tilejson: {{/__teaser__}}{{#__full__}}{{/__full__}} version: 1.0.0 format: png - generator: martin-cp v0.11.3 + generator: martin-cp v0.11.4 agg_tiles_hash: A85C80BA1CE047E2D93DAC25C5179775