Add short flags for CLI options; change map flags

Map width flag changed from -M to -W and height flag set to -H.
Added short flags: -w (wood), -i (iron), -L (supply limit),
-P (skill points), -m (mute soundtrack), -l (enable logging).
This commit is contained in:
2026-05-20 11:43:28 +02:00
parent e3c3ad96e3
commit c3b76a7c2e
+8 -2
View File
@@ -56,7 +56,7 @@ pub struct Cli {
/// Width of the generated map (36100 tiles). /// Width of the generated map (36100 tiles).
#[arg( #[arg(
long, long,
short = 'M', short = 'W',
help = "Map width", help = "Map width",
value_name = "Positive integer [36; 108]", value_name = "Positive integer [36; 108]",
default_value = "42", default_value = "42",
@@ -67,7 +67,7 @@ pub struct Cli {
/// Height of the generated map (1150 tiles). /// Height of the generated map (1150 tiles).
#[arg( #[arg(
long, long,
short, short = 'H',
help = "Map height", help = "Map height",
value_name = "Positive integer [11; 39]", value_name = "Positive integer [11; 39]",
default_value = "11", default_value = "11",
@@ -100,6 +100,7 @@ pub struct Cli {
/// Starting amount of wood (1150). /// Starting amount of wood (1150).
#[arg( #[arg(
long, long,
short = 'w',
help = "Starting wood", help = "Starting wood",
value_name = "Positive integer [1; 150]", value_name = "Positive integer [1; 150]",
default_value = "50", default_value = "50",
@@ -110,6 +111,7 @@ pub struct Cli {
/// Starting amount of iron (1150). /// Starting amount of iron (1150).
#[arg( #[arg(
long, long,
short = 'i',
help = "Starting iron", help = "Starting iron",
value_name = "Positive integer [1; 150]", value_name = "Positive integer [1; 150]",
default_value = "25", default_value = "25",
@@ -120,6 +122,7 @@ pub struct Cli {
/// Maximum amount of units (49149). /// Maximum amount of units (49149).
#[arg( #[arg(
long, long,
short = 'L',
help = "Supply limit", help = "Supply limit",
value_name = "Positive integer [49; 149]", value_name = "Positive integer [49; 149]",
default_value = "99", default_value = "99",
@@ -141,6 +144,7 @@ pub struct Cli {
/// Upper bound for skill points that can be earned (90690). /// Upper bound for skill points that can be earned (90690).
#[arg( #[arg(
long, long,
short = 'P',
help = "Skill points limit", help = "Skill points limit",
value_name = "Positive integer [90; 690]", value_name = "Positive integer [90; 690]",
default_value = "120", default_value = "120",
@@ -171,6 +175,7 @@ pub struct Cli {
/// Mute soundtrack (default: disabled). /// Mute soundtrack (default: disabled).
#[arg( #[arg(
long, long,
short = 'm',
help = "Mute soundtrack (default: disabled)", help = "Mute soundtrack (default: disabled)",
default_value_t = false default_value_t = false
)] )]
@@ -179,6 +184,7 @@ pub struct Cli {
/// Enable logging to a file (default: disabled). /// Enable logging to a file (default: disabled).
#[arg( #[arg(
long, long,
short = 'l',
help = "Enable logging to file (default: disabled)", help = "Enable logging to file (default: disabled)",
default_value_t = false default_value_t = false
)] )]