diff --git a/src/main.rs b/src/main.rs index 6fc27e5..404e3a6 100644 --- a/src/main.rs +++ b/src/main.rs @@ -35,7 +35,7 @@ struct DownloadHistorySubcommand{ cookie_type:CookieType, cookie:String, output_folder:Option, - continue_from_versions:bool, + continue_from_versions:Option, start_version:Option, end_version:Option, } @@ -66,9 +66,9 @@ struct DecompileSubcommand{ input_file:PathBuf, output_folder:PathBuf, style:DecompileStyle, - write_template:bool, - write_models:bool, - write_scripts:bool, + write_template:Option, + write_models:Option, + write_scripts:Option, } #[derive(Args)] struct DecompileHistoryIntoGitSubcommand{ @@ -78,9 +78,9 @@ struct DecompileHistoryIntoGitSubcommand{ style:DecompileStyle, git_committer_name:String, git_committer_email:String, - write_template:bool, - write_models:bool, - write_scripts:bool, + write_template:Option, + write_models:Option, + write_scripts:Option, } #[derive(Args)] struct DownloadAndDecompileHistoryIntoGitSubcommand{ @@ -92,9 +92,9 @@ struct DownloadAndDecompileHistoryIntoGitSubcommand{ style:DecompileStyle, git_committer_name:String, git_committer_email:String, - write_template:bool, - write_models:bool, - write_scripts:bool, + write_template:Option, + write_models:Option, + write_scripts:Option, } #[derive(Clone,clap::ValueEnum)] @@ -136,7 +136,7 @@ async fn main()->AResult<()>{ let cli=Cli::parse(); match cli.command{ Commands::DownloadHistory(subcommand)=>download_history(DownloadHistoryConfig{ - continue_from_versions:subcommand.continue_from_versions, + continue_from_versions:subcommand.continue_from_versions.unwrap_or(false), end_version:subcommand.end_version, start_version:subcommand.start_version.unwrap_or(0), output_folder:subcommand.output_folder.unwrap_or_else(||std::env::current_dir().unwrap()), @@ -169,9 +169,9 @@ async fn main()->AResult<()>{ style:subcommand.style, input_file:subcommand.input_file, output_folder:subcommand.output_folder, - write_template:subcommand.write_template, - write_models:subcommand.write_models, - write_scripts:subcommand.write_scripts, + write_template:subcommand.write_template.unwrap_or(false), + write_models:subcommand.write_models.unwrap_or(false), + write_scripts:subcommand.write_scripts.unwrap_or(true), }).await, Commands::DecompileHistoryIntoGit(subcommand)=>decompile_history_into_git(DecompileHistoryConfig{ git_committer_name:subcommand.git_committer_name, @@ -179,9 +179,9 @@ async fn main()->AResult<()>{ input_folder:subcommand.input_folder, output_folder:std::env::current_dir()?, style:subcommand.style, - write_template:subcommand.write_template, - write_models:subcommand.write_models, - write_scripts:subcommand.write_scripts, + write_template:subcommand.write_template.unwrap_or(false), + write_models:subcommand.write_models.unwrap_or(false), + write_scripts:subcommand.write_scripts.unwrap_or(true), }).await, Commands::DownloadAndDecompileHistoryIntoGit(subcommand)=>download_and_decompile_history_into_git(DownloadAndDecompileHistoryConfig{ git_committer_name:subcommand.git_committer_name, @@ -190,9 +190,9 @@ async fn main()->AResult<()>{ asset_id:subcommand.asset_id, output_folder:std::env::current_dir()?, style:subcommand.style, - write_template:subcommand.write_template, - write_models:subcommand.write_models, - write_scripts:subcommand.write_scripts, + write_template:subcommand.write_template.unwrap_or(false), + write_models:subcommand.write_models.unwrap_or(false), + write_scripts:subcommand.write_scripts.unwrap_or(true), }).await, } }