From be82baedc8701f545bc9da700fb5c04972bdc38f Mon Sep 17 00:00:00 2001 From: ashley Date: Fri, 1 Sep 2023 14:18:13 -0400 Subject: [PATCH] Some user experience tweaks --- src/reskit/cli/evaluator.rs | 8 ++++++-- src/reskit/cli/settings.rs | 6 +++--- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/src/reskit/cli/evaluator.rs b/src/reskit/cli/evaluator.rs index 8582152..97693e6 100644 --- a/src/reskit/cli/evaluator.rs +++ b/src/reskit/cli/evaluator.rs @@ -20,11 +20,15 @@ pub fn run_command() -> Result<(), Box> { TileOrder::Sprite => "sprite" } ), - Tools::Soundtrack { input_file, output_directory, input_format: _, output_format: _, source_file_format: _, artifact_output_directory } => { + Tools::Soundtrack { input_files, output_directory, input_format: _, output_format: _, source_file_format: _, artifact_output_directory } => { + if input_files.is_empty() { + return Err( "no input files (see `reskit soundtrack --help` for more info)" )?; + } + let output_directory = if output_directory.ends_with( "/" ) { output_directory.to_string() } else { format!( "{}/", output_directory ) }; let artifact_output_directory = if artifact_output_directory.ends_with( "/" ) { artifact_output_directory.to_string() } else { format!( "{}/", artifact_output_directory ) }; - let modules: Vec = input_file.iter().map( | filename | Ok( DmfModule::from_file( &filename )? ) ).collect::, Box>>()?; + let modules: Vec = input_files.iter().map( | filename | Ok( DmfModule::from_file( &filename )? ) ).collect::, Box>>()?; let mut combined_asset_list = DmfModule::get_combined_assets_list( artifact_output_directory.clone(), &modules )?; if combined_asset_list.instruments.len() > 255 { diff --git a/src/reskit/cli/settings.rs b/src/reskit/cli/settings.rs index 9a88113..49d688d 100644 --- a/src/reskit/cli/settings.rs +++ b/src/reskit/cli/settings.rs @@ -62,17 +62,17 @@ pub enum Tools { }, #[command(name = "soundtrack")] - #[command(about = "Generate a console-compatible soundtrack from a sequence file.")] + #[command(about = "Generate a soundtrack targeting a console sound driver, from one or more tracker sequence files.")] Soundtrack { /// Input filename(s) #[arg(short, long)] - input_file: Vec, + input_files: Vec, /// Output directory #[arg(short, long, default_value_t=String::from("./"))] output_directory: String, - /// Input sequence file format (the kind of tracker used to compose the track) + /// Input sequence file format (the tracker used to compose the track) #[arg(long, value_enum, default_value_t=SequenceFormat::Dmf)] input_format: SequenceFormat,