// SPDX-FileCopyrightText: 2026 Stan Grams // // SPDX-License-Identifier: GPL-2.0-or-later //! Regenerate `trx-rs.toml.example` from the config structs. //! //! Run from anywhere in the workspace: //! //! ```text //! cargo run -p trx-config --example generate_example //! ``` //! //! A test in `trx_config::example` fails when the checked-in file no longer //! matches, which is the reminder to run this. use std::path::PathBuf; fn main() -> std::io::Result<()> { let target: PathBuf = std::env::args() .nth(1) .map(PathBuf::from) .unwrap_or_else(|| { PathBuf::from(env!("CARGO_MANIFEST_DIR")).join("../../trx-rs.toml.example") }); std::fs::write(&target, trx_config::example::combined_example())?; println!("Wrote {}", target.display()); Ok(()) }