Cleanup sym command

This commit is contained in:
pjht 2022-10-20 14:51:06 -05:00
parent e62bcd261a
commit 943ac2b593

View File

@ -429,16 +429,14 @@ fn main() -> Result<(), ReplError> {
let table_name = Path::new(&file_path).file_name().unwrap().to_str().unwrap(); let table_name = Path::new(&file_path).file_name().unwrap().to_str().unwrap();
if args.get_flag("delete") { if args.get_flag("delete") {
state.symbol_tables.delete(table_name)?; state.symbol_tables.delete(table_name)?;
Ok(None)
} else if let Some(&active) = args.get_one::<bool>("active") { } else if let Some(&active) = args.get_one::<bool>("active") {
state.symbol_tables.set_active(table_name, active)?; state.symbol_tables.set_active(table_name, active)?;
Ok(None)
} else { } else {
state state
.symbol_tables .symbol_tables
.load_table(file_path, args.get_flag("append"))?; .load_table(file_path, args.get_flag("append"))?;
Ok(None)
} }
Ok(None)
} else if state.symbol_tables.is_empty() { } else if state.symbol_tables.is_empty() {
Ok(Some("No symbols".to_string())) Ok(Some("No symbols".to_string()))
} else { } else {