From 54c18628148a84e79481bff43d6211ee9f4e4429 Mon Sep 17 00:00:00 2001 From: "S.P.H" <7786502+StaticPH@users.noreply.github.com> Date: Fri, 5 Jan 2024 22:24:30 -0500 Subject: [PATCH 1/2] Add argument ranges and defaults to command line help text. --- cmdapp/src/main.rs | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/cmdapp/src/main.rs b/cmdapp/src/main.rs index b33bdf2..0121432 100644 --- a/cmdapp/src/main.rs +++ b/cmdapp/src/main.rs @@ -68,7 +68,7 @@ pub fn config_from_args() -> (PathBuf, PathBuf, Config) { .long("filter_speckle") .short("f") .takes_value(true) - .help("Discard patches smaller than X px in size"), + .help("Discard patches smaller than X px in size. Accepts integer values within the range [0, 16](Default: 4)"), ); let app = app.arg( @@ -76,7 +76,7 @@ pub fn config_from_args() -> (PathBuf, PathBuf, Config) { .long("color_precision") .short("p") .takes_value(true) - .help("Number of significant bits to use in an RGB channel"), + .help("Number of significant bits to use in an RGB channel. Accepts integer values within the range [1, 8](Default: 6)"), ); let app = app.arg( @@ -84,7 +84,7 @@ pub fn config_from_args() -> (PathBuf, PathBuf, Config) { .long("gradient_step") .short("g") .takes_value(true) - .help("Color difference between gradient layers"), + .help("Color difference between gradient layers. Accepts integer values within the range [0, 255]"), ); let app = app.arg( @@ -92,21 +92,21 @@ pub fn config_from_args() -> (PathBuf, PathBuf, Config) { .long("corner_threshold") .short("c") .takes_value(true) - .help("Minimum momentary angle (degree) to be considered a corner"), + .help("Minimum momentary angle (degree) to be considered a corner. Accepts integer values within the range [0, 180](Default: 60)"), ); let app = app.arg(Arg::with_name("segment_length") .long("segment_length") .short("l") .takes_value(true) - .help("Perform iterative subdivide smooth until all segments are shorter than this length")); + .help("Perform iterative subdivide smooth until all segments are shorter than this length. Accepts values within the range [3.5, 10](Default: 4.0)")); let app = app.arg( Arg::with_name("splice_threshold") .long("splice_threshold") .short("s") .takes_value(true) - .help("Minimum angle displacement (degree) to splice a spline"), + .help("Minimum angle displacement (degree) to splice a spline. Accepts integer values within the range [0, 180](Default: 45)"), ); let app = app.arg( From c0c61ffcb23e5e6fd4fd893f3e5baa6d3b638e9c Mon Sep 17 00:00:00 2001 From: Chris Tsang Date: Fri, 1 Mar 2024 13:15:08 +0000 Subject: [PATCH 2/2] Update cmdapp/src/main.rs Co-authored-by: Viktor Szakats --- cmdapp/src/main.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cmdapp/src/main.rs b/cmdapp/src/main.rs index 0121432..62af52c 100644 --- a/cmdapp/src/main.rs +++ b/cmdapp/src/main.rs @@ -84,7 +84,7 @@ pub fn config_from_args() -> (PathBuf, PathBuf, Config) { .long("gradient_step") .short("g") .takes_value(true) - .help("Color difference between gradient layers. Accepts integer values within the range [0, 255]"), + .help("Color difference between gradient layers. Accepts integer values within the range [0, 255](Default: 16)"), ); let app = app.arg(