From 44e01a60731b125df8d3f39220a0a469e1fed15c Mon Sep 17 00:00:00 2001 From: sam Date: Tue, 28 Nov 2023 17:24:44 -0800 Subject: [PATCH] argumentative tracer --- tracer/src/main.rs | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/tracer/src/main.rs b/tracer/src/main.rs index b61625dfa..168ccf521 100644 --- a/tracer/src/main.rs +++ b/tracer/src/main.rs @@ -1,6 +1,6 @@ extern crate tracer; -use std::{env, path::PathBuf}; +use std::env; use tracer::{trace, decode}; use common::serializable::Serializable; @@ -8,7 +8,13 @@ use common::path::JoltPaths; pub fn main() { // Note: assumes program is already compiled - let program_name = "hash"; + let args: Vec = env::args().collect(); + if args.len() != 2 { + eprintln!("Usage: {} ", args[0]); + std::process::exit(1); + } + let program_name = &args[1]; + let elf_location = JoltPaths::elf_path(program_name); let trace_destination = JoltPaths::trace_path(program_name); let bytecode_destination = JoltPaths::bytecode_path(program_name);