diff --git a/doc/preserves-schema-rs.md b/doc/preserves-schema-rs.md index aa205ed..2bd0e43 100644 --- a/doc/preserves-schema-rs.md +++ b/doc/preserves-schema-rs.md @@ -14,7 +14,7 @@ inputs. You will usually not need to use the `preserves-schema-rs` command-line program. Instead, access the preserves-schema compiler API from your `build.rs`. The following example is taken from -[`build.rs` for the `preserves-path` crate](https://gitlab.com/preserves/preserves/-/blob/18ac9168996026073ee16164fce108054b2a0ed7/implementations/rust/preserves-path/build.rs): +[`build.rs` for the `preserves-path` crate](https://gitlab.com/preserves/preserves/-/blob/af5de5b836ffc51999db93797d1995ff677cf6f8/implementations/rust/preserves-path/build.rs): use preserves_schema::compiler::*; @@ -30,14 +30,14 @@ API from your `build.rs`. The following example is taken from let mut c = CompilerConfig::new(gen_dir, "crate::schemas".to_owned()); let inputs = expand_inputs(&vec!["path.bin".to_owned()])?; - c.load_schemas_and_bundles(&inputs)?; + c.load_schemas_and_bundles(&inputs, &vec![])?; compile(&c) } This approach also requires an `include!` from your main, hand-written source tree. The following is a snippet from -[`preserves-path/src/lib.rs`](https://gitlab.com/preserves/preserves/-/blob/18ac9168996026073ee16164fce108054b2a0ed7/implementations/rust/preserves-path/src/lib.rs): +[`preserves-path/src/lib.rs`](https://gitlab.com/preserves/preserves/-/blob/af5de5b836ffc51999db93797d1995ff677cf6f8/implementations/rust/preserves-path/src/lib.rs): pub mod schemas { include!(concat!(env!("OUT_DIR"), "/src/schemas/mod.rs")); @@ -52,20 +52,22 @@ Then, `cargo install preserves-schema`. ## Usage - preserves-schema 1.0.0 + preserves-schema 3.990.2 USAGE: - preserves-schema-rs [OPTIONS] --output-dir --prefix [--] [input-glob]... + preserves-schema-rs [FLAGS] [OPTIONS] --output-dir --prefix [--] [input-glob]... FLAGS: - -h, --help Prints help information - -V, --version Prints version information + -h, --help Prints help information + --rustfmt-skip + -V, --version Prints version information OPTIONS: --module ... -o, --output-dir -p, --prefix --support-crate + --xref ... ARGS: ... diff --git a/implementations/rust/preserves-schema/src/compiler/mod.rs b/implementations/rust/preserves-schema/src/compiler/mod.rs index c593739..4633b23 100644 --- a/implementations/rust/preserves-schema/src/compiler/mod.rs +++ b/implementations/rust/preserves-schema/src/compiler/mod.rs @@ -19,7 +19,7 @@ //! let mut c = CompilerConfig::new(gen_dir, "crate::schemas".to_owned()); //! //! let inputs = expand_inputs(&vec![PATH_TO_PRB_FILE.to_owned()])?; -//! c.load_schemas_and_bundles(&inputs)?; +//! c.load_schemas_and_bundles(&inputs, &vec![])?; //! compile(&c) //! } //! ```