Skip to content

Commit

Permalink
minor cleanup (#199)
Browse files Browse the repository at this point in the history
  • Loading branch information
jessekrubin authored Nov 21, 2024
1 parent 49238a7 commit b528582
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 8 deletions.
16 changes: 9 additions & 7 deletions crates/utiles/src/cli/args.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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)]
Expand Down Expand Up @@ -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),

Expand All @@ -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
Expand Down Expand Up @@ -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]
Expand Down Expand Up @@ -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",
Expand Down
15 changes: 15 additions & 0 deletions crates/utiles/src/cli/commands/about.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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")),
Expand Down
1 change: 0 additions & 1 deletion crates/utiles/src/cli/mod.rs
Original file line number Diff line number Diff line change
@@ -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)]
Expand Down

0 comments on commit b528582

Please sign in to comment.