implicitly set input/output folder to current directory

This commit is contained in:
Quaternions 2024-04-28 18:41:03 -07:00
parent 66104be2d9
commit 59deac0155

View File

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