Handle CLI arguments as structured argument-parameter pairs

This commit is contained in:
Juno Takano 2025-12-14 15:08:55 -03:00
commit 2040854e82
7 changed files with 83 additions and 15 deletions

View file

@ -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}"),
};