This commit is contained in:
Jaby 2022-11-09 23:11:30 +01:00
parent 8f4b5a1e39
commit f0133e688a
2 changed files with 18 additions and 3 deletions

View File

@ -7,6 +7,7 @@ edition = "2021"
[dependencies]
cdtypes = {path = "../cdtypes"}
clap = {version = "*", features = ["derive"]}
paste = "*"
roxmltree = "*"
tool_helper = {path = "../tool_helper"}

View File

@ -1,7 +1,14 @@
use clap::{Parser, Subcommand};
use psxcdgen_ex::{encoder::psx::{encode_psx_image, calculate_psx_lbas}, file_writer::{ImageType, write_image}, types::{layout::Layout}, config_reader};
use std::{path::PathBuf, str::FromStr};
use tool_helper::Error;
#[derive(Parser)]
#[clap(about = "Creates an ISO image from a description file", long_about = None)]
struct CommandLine {
}
fn run_main() -> Result<(), Error> {
let desc = psxcdgen_ex::process(config_reader::parse_xml(std::fs::read_to_string("../Tests/ISO_Planschbecken.xml")?)?, calculate_psx_lbas)?;
@ -25,8 +32,15 @@ fn run_main() -> Result<(), Error> {
}
fn main() {
match run_main() {
Ok(_) => println!("\n<== Planschbecken End ==>"),
Err(error) => println!("{}", error)
match CommandLine::try_parse() {
Ok(_) => {
match run_main() {
Ok(_) => println!("\n<== Planschbecken End ==>"),
Err(error) => println!("{}", error)
}
},
Err(error) => {
println!("{}", error);
}
}
}