-
-
Notifications
You must be signed in to change notification settings - Fork 135
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
For now we just show it works within our generator. Next step is to actually generate docopts grammar.
- Loading branch information
Showing
2 changed files
with
31 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,30 @@ | ||
#![feature(plugin)] | ||
#![plugin(docopt_macros)] | ||
|
||
extern crate docopt; | ||
extern crate rustc_serialize; | ||
|
||
docopt!(Args derive Debug, " | ||
Usage: rtrace [options] (<OUTPUT-FILE>|-) | ||
rtrace --help | ||
|
||
Options: | ||
--width <X> The width of the output image [default: 1024] | ||
--height <Y> The height of the output image [default: 1024] | ||
--samples-per-pixel <SAMPLES> Amount of samples per pixel. 4 means 16 over-samples [default: 1] | ||
--num-cores <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. | ||
|
||
<OUTPUT-FILE>|- 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} !"); | ||
} |