Add command to resolve a location to an address

This commit is contained in:
pjht 2022-10-17 10:04:49 -05:00
parent 5c7a49342d
commit 366fd04745

View File

@ -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::<String>("location").unwrap();
Ok(Some(format!(
"{}",
parse_location(location, &state.symbol_tables)?.displayer(&state.symbol_tables)
)))
},
)
.with_command( .with_command(
Command::new("quit") Command::new("quit")
.visible_alias("q") .visible_alias("q")