Skip to main content

Module cli

Module cli 

Source
Expand description

The example’s command line.

The flags are declared with [argh], which derives the parser and the --help text from the Args struct. A value with a shape of its own — a WxH size — is parsed by the function Args names through from_str_fn, so the rules live next to the option they constrain.

Args::validate holds the checks that span more than one option: here, a scene the example does not know.

The scenes’ snapshots are not compared through this command line. That is a test’s job, and it lives in tests/gpu_suite.rs, where the same bodies run natively and in a browser.

Re-exports§

use argh::FromArgs; 🔒
use argh::FromArgs; 🔒
use crate::scenes; 🔒

Structs§

Args
Every option the example accepts.

Enums§

Parsed
What the command line asked the example to do.

Constants§

PROGRAM 🔒
The program name argh puts in its usage and error messages.

Functions§

default_scene 🔒
The scene --scene starts from.
parse
Parse the arguments after the program name.
parse_size 🔒
Parse a WxH size, both dimensions at least one pixel.
usage
The --help text: argh’s option list followed by the scene table.