diff --git a/src/main.rs b/src/main.rs index cdf8a3a..4620377 100644 --- a/src/main.rs +++ b/src/main.rs @@ -106,7 +106,7 @@ struct UploadSubcommand{ #[derive(Args)] struct CompileSubcommand{ #[arg(long)] - input_folder:PathBuf, + input_folder:Option, #[arg(long)] output_file:PathBuf, #[arg(long)] @@ -119,7 +119,7 @@ struct DecompileSubcommand{ #[arg(long)] input_file:PathBuf, #[arg(long)] - output_folder:PathBuf, + output_folder:Option, #[arg(long)] style:DecompileStyle, #[arg(long)] @@ -229,7 +229,7 @@ async fn main()->AResult<()>{ vec![(subcommand.asset_id,subcommand.input_file)] ).await, Commands::Compile(subcommand)=>compile(CompileConfig{ - input_folder:subcommand.input_folder, + input_folder:subcommand.input_folder.unwrap_or_else(||std::env::current_dir().unwrap()), output_file:subcommand.output_file, template:subcommand.template, style:subcommand.style, @@ -237,7 +237,7 @@ async fn main()->AResult<()>{ Commands::Decompile(subcommand)=>decompile(DecompileConfig{ style:subcommand.style, input_file:subcommand.input_file, - output_folder:subcommand.output_folder, + output_folder:subcommand.output_folder.unwrap_or_else(||std::env::current_dir().unwrap()), write_template:subcommand.write_template.unwrap_or(false), write_models:subcommand.write_models.unwrap_or(false), write_scripts:subcommand.write_scripts.unwrap_or(true),