This commit is contained in:
Quaternions 2024-03-15 10:52:49 -07:00
parent 91aa21a993
commit c43ed400c9

View File

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