added clap

This commit is contained in:
ALEZ-DEV 2024-06-18 19:18:52 +02:00
parent 107317afde
commit c6103be68d
3 changed files with 18 additions and 1 deletions

View File

@ -3,7 +3,7 @@ name = "babylonia-terminal-cli"
version = "0.1.0"
edition = "2021"
authors = ["ALEZ-DEV <raidersfocus@gmail.com>"]
description = "A launcher for a certain anime game "
description = "A launcher to launch a certain anime game on linux"
repository = "https://github.com/ALEZ-DEV/Babylonia-terminal"
license = "LGPL-3.0-or-later"
keywords = ["launcher", "game"]
@ -16,6 +16,8 @@ name = "babylonia-terminal-cli"
[dependencies]
anyhow = "1.0.83"
babylonia-terminal-sdk = { path = "./../babylonia-terminal-sdk" }
clap = { version = "4.5.7", features = ["derive"] }
derive = "1.0.0"
dialoguer = "0.11.0"
downloader = { git = "https://github.com/ALEZ-DEV/downloader" } # version = "0.2.7",
indicatif = "0.17.8"

View File

@ -0,0 +1,9 @@
use clap::Parser;
#[derive(Parser, Debug)]
#[command(author, version, about, long_about = None)]
pub struct Args {
/// Pass launch options to tink the behavior of the game
#[arg(long)]
pub options: Option<String>,
}

View File

@ -8,14 +8,17 @@ use babylonia_terminal_sdk::{
game_manager::GameManager,
game_state::GameState,
};
use clap::Parser;
use log::{debug, info, LevelFilter};
use simple_logger::SimpleLogger;
use tokio::io::{AsyncBufReadExt, BufReader};
use wincompatlib::prelude::*;
mod arguments;
pub mod reporter;
pub mod utils;
use crate::arguments::Args;
use crate::reporter::DownloadReporter;
#[tokio::main]
@ -34,6 +37,9 @@ async fn main() {
simple_logger.with_level(LevelFilter::Info).init().unwrap();
}
let args = Args::parse();
debug!("Launch option -> {:?}", args.options);
let mut proton_component: Option<ProtonComponent> = None;
let mut proton: Option<Proton> = None;