dump/dump.rs
1// Copyright © 2020-2021 Keegan Saunders
2//
3// Permission to use, copy, modify, and/or distribute this software for
4// any purpose with or without fee is hereby granted.
5//
6// THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
7// WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
8// MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
9// ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
10// WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN
11// AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT
12// OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
13//
14
15use std::env;
16use vtil_parser::{dump::dump_routine, Result, Routine};
17
18fn main() -> Result<()> {
19 let mut argv = env::args();
20 let routine = Routine::from_path(argv.nth(1).unwrap())?;
21 dump_routine(&mut std::io::stdout(), &routine).unwrap();
22 Ok(())
23}