Prepare using arguments and options
This commit is contained in:
@@ -35,9 +35,11 @@ pub trait SectorWriter {
|
||||
fn write(&mut self, sector: Sector) -> Result<usize, Error>;
|
||||
}
|
||||
|
||||
pub fn write_image(cd_desc: CDDesc, encoder: EncoderFunction, image_type: ImageType, output_path: PathBuf) -> Result<(), Error> {
|
||||
pub fn write_image(cd_desc: CDDesc, encoder: EncoderFunction, image_type: ImageType, mut output_path: PathBuf) -> Result<(), Error> {
|
||||
match image_type {
|
||||
ImageType::BinCue => {
|
||||
output_path.set_extension("bin");
|
||||
|
||||
let cue_output_path = {
|
||||
let mut cue_output_path = output_path.clone();
|
||||
|
||||
|
@@ -9,7 +9,7 @@ struct CommandLine {
|
||||
#[clap(value_enum, value_parser)]
|
||||
system_type: SystemType,
|
||||
|
||||
#[clap(value_enum, value_parser, default_value_t=OutputType::BinCue)]
|
||||
#[clap(value_enum, value_parser)]
|
||||
output_type: OutputType,
|
||||
|
||||
#[clap(short='o')]
|
||||
@@ -48,7 +48,7 @@ fn run_main() -> Result<(), Error> {
|
||||
}
|
||||
|
||||
println!("\n<== Planschbecken ==>\nStart encoding");
|
||||
write_image(desc, encode_psx_image, ImageType::BinCue, PathBuf::from_str("planschi.bin")?)
|
||||
write_image(desc, encode_psx_image, ImageType::BinCue, PathBuf::from_str("planschi")?)
|
||||
}
|
||||
|
||||
fn main() {
|
||||
|
Reference in New Issue
Block a user