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