Skip to content

Commit

Permalink
Update main.rs
Browse files Browse the repository at this point in the history
  • Loading branch information
Autoparallel committed Aug 9, 2024
1 parent 331f218 commit 7eef73e
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,14 @@ struct Args {
/// Keys to extract (can be specified multiple times)
#[arg(short, long)]
keys: Vec<String>,

/// Output directory (will be created if it doesn't exist)
#[arg(short, long, default_value = ".")]
output_dir: PathBuf,

/// Output filename (will be created if it doesn't exist)
#[arg(short, long, default_value = "output.json")]
filename: String,
}

#[derive(serde::Serialize)]
Expand Down Expand Up @@ -48,7 +56,8 @@ pub fn main() -> Result<(), Box<dyn std::error::Error>> {
data,
};

let mut file = std::fs::File::create("input.json")?;
let output_file = args.output_dir.join(args.filename);
let mut file = std::fs::File::create(output_file)?;
file.write_all(serde_json::to_string_pretty(&witness)?.as_bytes())?;

println!("Input file created successfully.");
Expand Down

0 comments on commit 7eef73e

Please sign in to comment.