config_disassembler/xml_cmd.rs
1//! `xml` subcommand: thin wrapper around the in-tree XML disassembler CLI.
2//!
3//! All arguments after `config-disassembler xml` are forwarded directly to
4//! [`crate::xml::cli::run`], so every option from the original
5//! `xml-disassembler` crate works unchanged here. This subcommand
6//! intentionally does not duplicate any of the XML logic — it simply
7//! delegates to the in-tree port.
8
9use crate::error::{Error, Result};
10
11/// Run the in-tree XML disassembler CLI with the provided arguments.
12///
13/// `args` should be the trailing arguments after `config-disassembler xml`,
14/// e.g. `["disassemble", "path/to/file.xml", "--format", "json"]`.
15pub async fn run(args: Vec<String>) -> Result<()> {
16 let mut forwarded = Vec::with_capacity(args.len() + 1);
17 forwarded.push("xml-disassembler".to_string());
18 forwarded.extend(args);
19
20 crate::xml::cli::run(forwarded)
21 .await
22 .map_err(|e| Error::Xml(e.to_string()))
23}