From 366fd04745a1e263cf76643b6cebf14e83e0bf8b Mon Sep 17 00:00:00 2001 From: pjht Date: Mon, 17 Oct 2022 10:04:49 -0500 Subject: [PATCH] Add command to resolve a location to an address --- src/main.rs | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/src/main.rs b/src/main.rs index ff9ad33..cde5b67 100644 --- a/src/main.rs +++ b/src/main.rs @@ -534,6 +534,22 @@ fn main() -> Result<(), ReplError> { } }, ) + .with_command( + Command::new("resolve") + .arg( + Arg::new("location") + .help("The location to resolve") + .required(true), + ) + .help("Resolve a location to an address"), + |args, state| { + let location = args.get_one::("location").unwrap(); + Ok(Some(format!( + "{}", + parse_location(location, &state.symbol_tables)?.displayer(&state.symbol_tables) + ))) + }, + ) .with_command( Command::new("quit") .visible_alias("q")