From b52858202d032fdb76737bf36a6eed8c1ad64450 Mon Sep 17 00:00:00 2001 From: jesse Date: Thu, 21 Nov 2024 09:05:00 -0800 Subject: [PATCH] minor cleanup (#199) --- crates/utiles/src/cli/args.rs | 16 +++++++++------- crates/utiles/src/cli/commands/about.rs | 15 +++++++++++++++ crates/utiles/src/cli/mod.rs | 1 - 3 files changed, 24 insertions(+), 8 deletions(-) diff --git a/crates/utiles/src/cli/args.rs b/crates/utiles/src/cli/args.rs index dcc8e9b2..aecaad5a 100644 --- a/crates/utiles/src/cli/args.rs +++ b/crates/utiles/src/cli/args.rs @@ -25,7 +25,12 @@ use crate::tile_strfmt::TileStringFormatter; /// ╚═════╝ ╚═╝ ╚═╝╚══════╝╚══════╝╚══════╝ fn about() -> String { - format!("utiles cli (rust) ~ v{VERSION}") + let is_debug: bool = cfg!(debug_assertions); + if is_debug { + format!("utiles cli (rust) ~ v{VERSION} ~ DEBUG") + } else { + format!("utiles cli (rust) ~ v{VERSION}") + } } #[derive(Debug, Parser)] @@ -567,7 +572,7 @@ pub enum Commands { #[command(name = "lint")] Lint(LintArgs), - /// Agg hash db + /// Aggregate tile hashes for tiles-db #[command(name = "agg-hash")] AggHash(AggHashArgs), @@ -588,7 +593,7 @@ pub enum Commands { Enumerate(EnumerateArgs), /// rm-rf dirpath - #[command(name = "rimraf", visible_alias = "rmrf")] + #[command(name = "rimraf", visible_alias = "rmrf", hide = true)] Rimraf(RimrafArgs), /// Echo mbtiles info/stats @@ -621,7 +626,7 @@ pub enum Commands { TILE CLI UTILS - MERCANTILE LIKE CLI ======================================================================== */ - /// Format json-tiles format-string + /// Format json-tiles `[x, y, z]` tiles w/ format-string /// /// fmt-tokens: /// `{json_arr}`/`{json}` -> [x, y, z] @@ -809,9 +814,6 @@ pub enum Commands { )] Webpify(WebpifyArgs), - // /// Optimize pngs with `oxipng` for raster tiles-db - // #[command(name = "oxipng", hide = true)] - // Oxipng(OxipngArgs), /// Convert raster mbtiles to webp format #[command( name = "optimize", diff --git a/crates/utiles/src/cli/commands/about.rs b/crates/utiles/src/cli/commands/about.rs index 49b1c360..198b70f5 100644 --- a/crates/utiles/src/cli/commands/about.rs +++ b/crates/utiles/src/cli/commands/about.rs @@ -8,6 +8,21 @@ pub fn about_main() -> UtilesResult<()> { } else { "release" }; + // if (json){ + // let j = serde_json::json! ({ + // "name": env!("CARGO_PKG_NAME"), + // "version": env!("CARGO_PKG_VERSION"), + // "authors": env!("CARGO_PKG_AUTHORS"), + // "desc": env!("CARGO_PKG_DESCRIPTION"), + // "repo": env!("CARGO_PKG_REPOSITORY"), + // "which": current_exe.display().to_string(), + // "profile": prof, + + // }); + // println!("{}", serde_json::to_string_pretty(&j)?); + // return Ok(()); + // } + let parts = [ format!("{} ~ {}", env!("CARGO_PKG_NAME"), env!("CARGO_PKG_VERSION")), format!("version: {}", env!("CARGO_PKG_VERSION")), diff --git a/crates/utiles/src/cli/mod.rs b/crates/utiles/src/cli/mod.rs index e6c25118..36279aa5 100644 --- a/crates/utiles/src/cli/mod.rs +++ b/crates/utiles/src/cli/mod.rs @@ -1,7 +1,6 @@ #![deny(clippy::all)] #![deny(clippy::perf)] #![warn(clippy::style)] -// #![warn(clippy::pedantic)] #![allow(clippy::module_name_repetitions)] #![allow(clippy::missing_errors_doc)] #![allow(clippy::missing_panics_doc)]