diff --git a/etc/api/type-cli.yaml b/etc/api/type-cli.yaml index e0b00574ccb..de316255292 100644 --- a/etc/api/type-cli.yaml +++ b/etc/api/type-cli.yaml @@ -19,3 +19,7 @@ make: cargo: build_version: "0.0.1" keywords: [cli] + dependencies: + - docopt = "*" + - docopt_macros = "*" + - rustc-serialize = "*" diff --git a/src/mako/cli/main.rs.mako b/src/mako/cli/main.rs.mako index 6ab592c6a84..69a75119429 100644 --- a/src/mako/cli/main.rs.mako +++ b/src/mako/cli/main.rs.mako @@ -1,3 +1,30 @@ +#![feature(plugin)] +#![plugin(docopt_macros)] + +extern crate docopt; +extern crate rustc_serialize; + +docopt!(Args derive Debug, " +Usage: rtrace [options] (|-) + rtrace --help + +Options: +--width The width of the output image [default: 1024] +--height The height of the output image [default: 1024] +--samples-per-pixel Amount of samples per pixel. 4 means 16 over-samples [default: 1] +--num-cores Amount of cores to do the rendering on [default: 1] + If this is not set, you may also use the RTRACEMAXPROCS + environment variable, e.g. RTRACEMAXPROCS=4. + The commandline always overrides environment variables. + +|- Either a file with .tga extension, or - to write file to stdout +" +, flag_samples_per_pixel: u16 +, flag_height: u16 +, flag_width: u16 +, flag_num_cores: usize); + fn main() { + let _: Args = Args::docopt().decode().unwrap_or_else(|e| e.exit()); println!("Hello, ${id} !"); } \ No newline at end of file