Extend batch file to use run commands

This commit is contained in:
2022-11-11 15:54:35 +01:00
parent 8f2359ffc6
commit a68b4f520d
3 changed files with 36 additions and 2 deletions

View File

@@ -1,4 +1,4 @@
use clap::{Parser, Subcommand};
use clap::{Parser, ValueEnum};
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;
@@ -6,7 +6,27 @@ use tool_helper::Error;
#[derive(Parser)]
#[clap(about = "Creates an ISO image from a description file", long_about = None)]
struct CommandLine {
#[clap(value_enum, value_parser)]
system_type: SystemType,
#[clap(value_enum, value_parser, default_value_t=OutputType::BinCue)]
output_type: OutputType,
#[clap(short='o')]
output_file: PathBuf,
#[clap(value_parser)]
input_file: PathBuf,
}
#[derive(Copy, Clone, PartialEq, Eq, PartialOrd, Ord, ValueEnum)]
enum SystemType {
Psx
}
#[derive(Copy, Clone, PartialEq, Eq, PartialOrd, Ord, ValueEnum)]
enum OutputType {
BinCue
}
fn run_main() -> Result<(), Error> {