1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
//! glsltc is the default compiler front-end for the GLSLT language. To use the GLSLT transforms
//! from Rust or Python code, see the documentation for the
//! [glslt](https://vtavernier.github.io/glslt/doc/glslt/) crate.
//!
//! # Installation
//!
//! Extract the pre-built binary for your platform from the
//! [releases](https://github.com/vtavernier/glslt/releases/) somewhere in your `$PATH`.
//!
//! Alternatively, you may compile GLSLT from source and install it using `cargo install --force .`
//!
//! # Command-line usage
//!
//! ```bash
//! GLSL Template compiler
//!
//! Usage: glsltc [OPTIONS] [INPUT]...
//!
//! Arguments:
//!   [INPUT]...  Input template files
//!
//! Options:
//!   -q, --quiet                Quiet mode
//!   -v, --verbose...           Verbose mode. Repeat to increase verbosity
//!   -o, --output <OUTPUT>      Output file (defaults to stdout)
//!   -I <INCLUDE>               System include paths
//!   -K, --keep-fns <KEEP_FNS>  List of symbols to keep for minifying mode
//!   -p, --prefix <PREFIX>      Identifier prefix for generated code
//!   -h, --help                 Print help information
//! ```
//!
//! # Examples
//!
//! ```bash
//! # Transform the GLSLT code in `sdf.glsl` to the output file `output.glsl`
//! glsltc -o output.glsl sdf.glsl
//!
//! # Transform the GLSLT code in `sdf.glsl` to the output file `output.glsl`. Only keep
//! # transitive dependencies of the `mainImage` function (minifying mode).
//! glsltc -o output.glsl -K=mainImage sdf.glsl
//! ```

use glslt::api::cli::*;

fn main() -> Result<(), Box<dyn std::error::Error>> {
    glslt::api::cli::main(Opts::parse())
}