Files
benilla-octo/crates/benilla-formats/examples/dump_file.rs
T
SamandClaude Fable 5 2ad0043523 benilla: initial public release
A from-scratch World of Warcraft 1.12.1 client in Rust + Bevy.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-24 14:27:01 +07:00

19 lines
766 B
Rust

//! Dump any file from the 5875 patch chain to stdout — the generic MPQ extractor for
//! reference reads (FrameXML sources, DBC layouts): `cargo run -p benilla-formats
//! --example dump_file -- 'Interface\FrameXML\TradeSkillFrame.lua'`. Output is Blizzard
//! data — pipe it to the scratchpad, never into the repo.
use std::io::Write;
use std::path::PathBuf;
fn main() -> anyhow::Result<()> {
let virt = std::env::args()
.nth(1)
.ok_or_else(|| anyhow::anyhow!("usage: dump_file <virtual\\mpq\\path>"))?;
let data = PathBuf::from(env!("CARGO_MANIFEST_DIR")).join("../../WoW/Data");
let mut chain = benilla_formats::open_chain(&data)?;
let bytes = chain.read_file(&virt)?;
std::io::stdout().write_all(&bytes)?;
Ok(())
}