Handle CLI arguments as structured argument-parameter pairs
This commit is contained in:
parent
f811c33192
commit
2040854e82
7 changed files with 83 additions and 15 deletions
|
|
@ -1,9 +1,13 @@
|
|||
use std::collections::HashMap;
|
||||
|
||||
use crate::types::{Graph, Node, Edge};
|
||||
use crate::{
|
||||
syntax::arguments::Arguments,
|
||||
types::{Edge, Graph, Node},
|
||||
};
|
||||
|
||||
pub fn populate_graph() -> Graph {
|
||||
let toml_source = match std::fs::read_to_string("./static/graph.toml") {
|
||||
let args = Arguments::new().parse();
|
||||
let toml_source = match std::fs::read_to_string(args.graph_path) {
|
||||
Ok(s) => s,
|
||||
Err(e) => format!("Error: {e}"),
|
||||
};
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue