MCPcopy Create free account
hub / github.com/Notgnoshi/generative / CmdlineOptions

Class CmdlineOptions

tools/attractor.rs:16–96  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

14#[derive(Debug, Parser)]
15#[clap(name = "attractor", verbatim_doc_comment)]
16struct CmdlineOptions {
17 /// The log level
18 #[clap(short, long, default_value_t = tracing::Level::INFO)]
19 log_level: tracing::Level,
20
21 #[clap(short = 'O', long, default_value_t = OutputFormat::Points)]
22 output_format: OutputFormat,
23
24 #[clap(short, long, required_if_eq("output_format", "image"))]
25 output: Option<PathBuf>,
26
27 /// The width of the output image
28 ///
29 /// If not given, an appropriate width will be chosen
30 #[clap(short = 'W', long)]
31 width: Option<u32>,
32
33 /// The height of the output image
34 ///
35 /// If not given, an appropriate height will be chosen
36 #[clap(short = 'H', long)]
37 height: Option<u32>,
38
39 /// Mathematical expressions defining the dynamical system
40 ///
41 /// The --math argument may be provided multiple times. The initial values of x and y will be
42 /// populated, and the expression is expected to define new variables x_new and y_new.
43 #[clap(short, long)]
44 math: Vec<String>,
45
46 /// The path to a rune script defining the dynamical system
47 ///
48 /// Has the same rules as --math. May be combined with --math (all --math arguments are
49 /// appended to the end of the script).
50 #[clap(short, long)]
51 script: Option<String>,
52
53 /// Parameters to define when the dynamical system is evaluated
54 ///
55 /// May be given multiple times. Each parameter should be defined as '-p name=value'
56 ///
57 /// Anything defined with --math or --script may override these parameters.
58 #[clap(short, long)]
59 parameter: Vec<String>,
60
61 /// Letters A..=Y used to generate the values of parameters a_1, a_2, ..., a_n
62 ///
63 /// Example: "ABCD" will generate parameters a_1=-1.2, a_2=-1.1, a_3=-1.0, a_4=-0.9
64 ///
65 /// Example: "WXY" will generate parameters a_1=1.0, a_2=1.1, a_3=1.2
66 ///
67 /// Anything defined with --math or --script may override these parameters.
68 #[clap(long)]
69 letters: Option<String>,
70
71 /// The random seed to use. Use zero to let the tool pick its own random seed.
72 #[clap(long, default_value_t = 0)]
73 seed: u64,

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected