MCPcopy Create free account
hub / github.com/emwalker/digraph / parse_args

Function parse_args

backend/src/bin/export.rs:30–54  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

28}
29
30fn parse_args() -> Opts {
31 let args: Vec<String> = env::args().collect();
32 // let program = args[0].clone();
33
34 let mut opts = Options::new();
35 opts.reqopt(
36 "d",
37 "data-dir",
38 "root directory of a repo_id to export to",
39 "DIRNAME",
40 );
41
42 let matches = match opts.parse(&args[1..]) {
43 Ok(m) => m,
44 Err(f) => {
45 panic!("{}", f.to_string())
46 }
47 };
48 let data_directory = matches.opt_str("d").expect("expected a data directory");
49 let root = Path::new(&data_directory);
50
51 Opts {
52 root: PathBuf::from(root),
53 }
54}
55
56fn prefer_private_repo(repo_1: RepoId, repo_2: RepoId) -> RepoId {
57 if repo_1.is_wiki() {

Callers 1

mainFunction · 0.70

Calls 1

parseMethod · 0.45

Tested by

no test coverage detected