Add comprehensive CLI options for game settings

- Expanded `Cli` with arguments for username, game mode, map size, perk
  deck, resources, supply limit, XP modifier, and skill points limit.
- Enabled the `cli` module in `lib.rs` and activated argument parsing in
  `main.rs`.
- Added placeholder (commented) fields to `App` for future configuration
  integration.
This commit is contained in:
2026-03-09 16:54:10 +01:00
parent e98f1ddc24
commit a9b84bbe0f
5 changed files with 49 additions and 11 deletions
+35 -1
View File
@@ -2,7 +2,41 @@ use clap::Parser;
#[derive(Parser, Debug)]
#[command(version, about = "War in Tunnels", long_about = "War in Tunnels")]
pub struct Cli {}
pub struct Cli {
#[arg(long, help = "Username", value_name = "String")]
pub username: String,
#[arg(long, help = "Game mode", value_name = "LastManStanding or FrontLines")]
pub game_mode: String,
#[arg(long, help = "Map width", value_name = "Positive integer [20; 100]")]
pub map_width: u8,
#[arg(long, help = "Map height", value_name = "Positive integer [11; 50]")]
pub map_height: u8,
#[arg(long, help = "Perk Deck", value_name = "String (check Perk Deck tab)")]
pub perk_deck: String,
#[arg(long, help = "Starting wood", value_name = "Positive integer")]
pub starting_wood: u8,
#[arg(long, help = "Starting iron", value_name = "Positive integer")]
pub starting_iron: u8,
#[arg(long, help = "Supply limit", value_name = "Positive integer")]
pub supply_limit: u8,
#[arg(long, help = "XP modifier", value_name = "Float [0.5; 2.0]")]
pub xp_modifier: f32,
#[arg(
long,
help = "Skill points limit",
value_name = "Positive integer [120; 690]"
)]
pub skill_points_limit: u16,
}
pub fn get_args() -> Cli {
Cli::parse()