Skip to main content

config_disassembler/
lib.rs

1//! config-disassembler
2//!
3//! Disassemble configuration files (XML, JSON, JSON5, YAML, TOML) into
4//! smaller files and reassemble the original on demand. The XML
5//! implementation lives in the in-tree [`xml`] module (ported from the
6//! upstream `xml-disassembler` crate); JSON, JSON5, and YAML share a
7//! common value model so a file in one format can be split into files
8//! of another format and reassembled back into any of those three.
9//! TOML is intentionally isolated and can only be converted to and
10//! from TOML, because TOML cannot represent `null`, forbids array
11//! roots, and forces bare keys to precede tables (which would reorder
12//! values on round-trip through other formats).
13//!
14//! Every disassemble action accepts a directory as input; when given a
15//! directory the runner walks it (filtering with the optional
16//! `--ignore-path`, defaulting to [`ignore_file::DEFAULT_IGNORE_FILENAME`])
17//! and disassembles every matching file in place.
18
19pub mod cli;
20pub mod disassemble;
21pub mod error;
22pub mod format;
23pub mod ignore_file;
24pub mod meta;
25pub mod reassemble;
26pub mod xml;
27pub mod xml_cmd;
28
29pub use error::{Error, Result};
30
31/// Entry point used by the binary. `args[0]` is the program name.
32pub async fn run(args: Vec<String>) -> Result<()> {
33    cli::dispatch(args).await
34}