MCPcopy Create free account
hub / github.com/cosdata/cosdata / from_args

Method from_args

org/src/viewer.rs:13–24  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

11
12impl Opt {
13 fn from_args() -> Self {
14 let args: Vec<String> = std::env::args().collect();
15 if args.len() < 2 {
16 eprintln!("Usage: binary-parser <input> <skip_bytes>");
17 std::process::exit(1);
18 }
19
20 Self {
21 input: PathBuf::from(&args[1]),
22 skip_bytes: args.get(2).and_then(|arg| arg.parse().ok()).unwrap_or(0),
23 }
24 }
25}
26
27#[allow(unused)]

Callers

nothing calls this directly

Calls 3

okMethod · 0.80
lenMethod · 0.45
getMethod · 0.45

Tested by

no test coverage detected