From b89a787af22be8e5b816e793ec58e5e3aa69c29f Mon Sep 17 00:00:00 2001 From: Quaternions Date: Tue, 2 Jul 2024 14:34:54 -0700 Subject: [PATCH] move type conversion to argument stuff --- src/main.rs | 36 ++++++++++++++++++------------------ 1 file changed, 18 insertions(+), 18 deletions(-) diff --git a/src/main.rs b/src/main.rs index 9cb4159..c32c9db 100644 --- a/src/main.rs +++ b/src/main.rs @@ -261,7 +261,7 @@ async fn main()->AResult<()>{ cookie:Cookie::from_type(subcommand.cookie_type,subcommand.cookie).await?.0, asset_id:subcommand.asset_id, output_folder:subcommand.output_folder.unwrap_or_else(||std::env::current_dir().unwrap()), - style:subcommand.style, + style:subcommand.style.rox(), write_template:subcommand.write_template.unwrap_or(false), write_models:subcommand.write_models.unwrap_or(false), write_scripts:subcommand.write_scripts.unwrap_or(true), @@ -290,18 +290,18 @@ async fn main()->AResult<()>{ input_folder:subcommand.input_folder.unwrap_or_else(||std::env::current_dir().unwrap()), output_file:subcommand.output_file, template:subcommand.template, - style:subcommand.style, + style:subcommand.style.map(|s|s.rox()), }).await, Commands::CompileUpload(subcommand)=>compile_upload(CompileUploadConfig{ input_folder:subcommand.input_folder.unwrap_or_else(||std::env::current_dir().unwrap()), template:subcommand.template, - style:subcommand.style, + style:subcommand.style.map(|s|s.rox()), cookie:Cookie::from_type(subcommand.cookie_type,subcommand.cookie).await?.0, group:subcommand.group, asset_id:subcommand.asset_id, }).await, Commands::Decompile(subcommand)=>decompile(DecompileConfig{ - style:subcommand.style, + style:subcommand.style.rox(), input_file:subcommand.input_file, output_folder:subcommand.output_folder.unwrap_or_else(||std::env::current_dir().unwrap()), write_template:subcommand.write_template.unwrap_or(false), @@ -313,7 +313,7 @@ async fn main()->AResult<()>{ git_committer_email:subcommand.git_committer_email, input_folder:subcommand.input_folder, output_folder:std::env::current_dir()?, - style:subcommand.style, + style:subcommand.style.rox(), write_template:subcommand.write_template.unwrap_or(false), write_models:subcommand.write_models.unwrap_or(false), write_scripts:subcommand.write_scripts.unwrap_or(true), @@ -324,7 +324,7 @@ async fn main()->AResult<()>{ cookie:Cookie::from_type(subcommand.cookie_type,subcommand.cookie).await?.0, asset_id:subcommand.asset_id, output_folder:std::env::current_dir()?, - style:subcommand.style, + style:subcommand.style.rox(), write_template:subcommand.write_template.unwrap_or(false), write_models:subcommand.write_models.unwrap_or(false), write_scripts:subcommand.write_scripts.unwrap_or(true), @@ -605,7 +605,7 @@ fn load_dom(input:R)->AResult{ struct DecompileConfig{ - style:Style, + style:rox_compiler::Style, input_file:PathBuf, output_folder:PathBuf, write_template:bool, @@ -627,7 +627,7 @@ async fn decompile(config:DecompileConfig)->AResult<()>{ //generate folders, models, and scripts //delete models and scripts from dom context.write_files(rox_compiler::WriteConfig{ - style:config.style.rox(), + style:config.style, output_folder:config.output_folder, write_template:config.write_template, write_models:config.write_models, @@ -640,7 +640,7 @@ async fn decompile(config:DecompileConfig)->AResult<()>{ struct DownloadDecompileConfig{ cookie:String, asset_id:AssetID, - style:Style, + style:rox_compiler::Style, output_folder:PathBuf, write_template:bool, write_models:bool, @@ -655,7 +655,7 @@ async fn download_decompile(config:DownloadDecompileConfig)->AResult<()>{ let context=rox_compiler::DecompiledContext::from_dom(dom); context.write_files(rox_compiler::WriteConfig{ - style:config.style.rox(), + style:config.style, output_folder:config.output_folder, write_template:config.write_template, write_models:config.write_models, @@ -669,7 +669,7 @@ struct WriteCommitConfig{ git_committer_name:String, git_committer_email:String, output_folder:PathBuf, - style:Style, + style:rox_compiler::Style, write_template:bool, write_models:bool, write_scripts:bool, @@ -699,7 +699,7 @@ async fn write_commit(config:WriteCommitConfig,b:Result, - style:Option