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

Class CmdlineOptions

tools/traverse.rs:18–60  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

16#[derive(Debug, Parser)]
17#[clap(name = "traverse", verbatim_doc_comment)]
18struct CmdlineOptions {
19 /// The log level
20 #[clap(long, default_value_t = tracing::Level::INFO)]
21 log_level: tracing::Level,
22
23 /// Input file to read input from. Defaults to stdin.
24 ///
25 /// Input format is expected to be Trivial Graph Format.
26 #[clap(short, long)]
27 input: Option<PathBuf>,
28
29 /// Output file to write result to. Defaults to stdout.
30 #[clap(short, long)]
31 output: Option<PathBuf>,
32
33 /// The random seed to use. Use zero to let the tool pick its own random seed.
34 #[clap(long, default_value_t = 0)]
35 seed: u64,
36
37 /// The number of random graph traversals to perform
38 #[clap(short = 't', long, default_value_t = 1)]
39 traversals: u8,
40
41 /// Whether to perform a random number of traverals with mean '--traversals'
42 #[clap(short = 'T', long, default_value_t = false)]
43 random_traversals: bool,
44
45 /// The length of each random traversal
46 #[clap(short = 'l', long, default_value_t = 4)]
47 length: u8,
48
49 /// Whether to make the length of each traversal random with mean '--length'
50 #[clap(short = 'L', long, default_value_t = false)]
51 random_length: bool,
52
53 /// Remove edges after traversing them
54 #[clap(short = 'r', long, default_value_t = false)]
55 remove_after_traverse: bool,
56
57 /// Output untraversed nodes at the end
58 #[clap(short = 'u', long, default_value_t = false)]
59 untraversed: bool,
60}
61
62fn generate_random_seed_if_not_specified(seed: u64) -> u64 {
63 if seed == 0 {

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected