Add flag for outputing dump file
This commit is contained in:
parent
06a652cce4
commit
a4f433be55
|
@ -78,7 +78,7 @@
|
|||
{
|
||||
"id": "cargo run args",
|
||||
"type": "pickString",
|
||||
"options": ["", "--help", "psx bin-cue -o ../Tests/Test_Planschbecken ../Tests/ISO_Planschbecken.xml"],
|
||||
"options": ["", "--help", "--list -o ../Tests/Test_Planschbecken psx bin-cue ../Tests/ISO_Planschbecken.xml"],
|
||||
"default": "",
|
||||
"description": "Argument options to pass to cargo run"
|
||||
}
|
||||
|
|
|
@ -6,16 +6,19 @@ 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)]
|
||||
#[clap(value_enum, value_parser, help="Specifies the system for which to create the disc image")]
|
||||
system_type: SystemType,
|
||||
|
||||
#[clap(value_enum, value_parser)]
|
||||
#[clap(value_enum, value_parser, help="Specifies the disc image type")]
|
||||
output_type: ImageType,
|
||||
|
||||
#[clap(short='o')]
|
||||
#[clap(short='o', help="Output path; Some OUTPUT_TYPE might create additional files with different endings")]
|
||||
output_file: PathBuf,
|
||||
|
||||
#[clap(value_parser)]
|
||||
#[clap(long="list", id="Path to file", help="If set will list the CD content to stdout; With path will output list to file")]
|
||||
list_content: Option<Option<PathBuf>>,
|
||||
|
||||
#[clap(value_parser, help="Input XML path for creating the image")]
|
||||
input_file: PathBuf,
|
||||
}
|
||||
|
||||
|
@ -44,7 +47,9 @@ fn run_main(cmd_line: CommandLine) -> Result<(), Error> {
|
|||
}
|
||||
println!("\n<== Planschbecken ==>");*/
|
||||
|
||||
psxcdgen_ex::dump_content(&desc, tool_helper::open_output(None)?)?;
|
||||
if let Some(list_content_option) = cmd_line.list_content {
|
||||
psxcdgen_ex::dump_content(&desc, tool_helper::open_output(list_content_option)?)?;
|
||||
}
|
||||
write_image(desc, encoding_functions.encoder, cmd_line.output_type, cmd_line.output_file)
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue