Pick this up again, dust it off, get some stuff connected.

This commit is contained in:
2022-02-13 21:30:06 -08:00
parent 91d5d1b4fd
commit 60e7d9a41d
6 changed files with 122 additions and 20 deletions

View File

@@ -1,3 +1,29 @@
fn main() {
println!("Hello, world!");
use clap::Parser;
use ngr::syntax::{ParserError, Program};
#[derive(Parser, Debug)]
#[clap(author, version, about, long_about = None)]
struct CommandLineArguments {
/// Optional output file name
#[clap(short, long)]
output: Option<String>,
/// The file to parse
file: String
}
fn real_main() -> Result<(), ParserError> {
let args = CommandLineArguments::parse();
let program = Program::from_file(&args.file)?;
println!("args: {:?}", args);
println!("program: {:?}", program);
Ok(())
}
fn main() {
if let Err(e) = real_main() {
println!("{}", e);
}
}