Mike Gerwitz

Activist for User Freedom

aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMike Gerwitz <mike.gerwitz@ryansg.com>2020-03-25 14:27:10 -0400
committerMike Gerwitz <mike.gerwitz@ryansg.com>2020-03-26 09:08:13 -0400
commit7a972465ead33323f1bacb35e17b016b6949aadd (patch)
tree2ae30c17ebd7f767f0f73d2663a276ef32748296
parent05d03dc4bbdcffae7fb1424ff5a9d78dc68eb0c2 (diff)
downloadtame-7a972465ead33323f1bacb35e17b016b6949aadd.tar.gz
tame-7a972465ead33323f1bacb35e17b016b6949aadd.tar.bz2
tame-7a972465ead33323f1bacb35e17b016b6949aadd.zip
[DEV-7087] TAMER: tameld: Format error output
We will want an option for verbose debug output in the future.
-rw-r--r--tamer/src/bin/tameld.rs10
-rw-r--r--tamer/src/ir/asg/mod.rs4
2 files changed, 11 insertions, 3 deletions
diff --git a/tamer/src/bin/tameld.rs b/tamer/src/bin/tameld.rs
index e3ca4b0..bf91e94 100644
--- a/tamer/src/bin/tameld.rs
+++ b/tamer/src/bin/tameld.rs
@@ -45,7 +45,15 @@ pub fn main() -> Result<(), Box<dyn Error>> {
let usage = opts.usage(&format!("Usage: {} -o OUTPUT FILE", program));
match parse_options(opts, args) {
- Ok(Command::Link(input, output)) => poc::main(&input, &output),
+ Ok(Command::Link(input, output)) => match poc::main(&input, &output) {
+ Err(e) => {
+ eprintln!("error: {}", e);
+ eprintln!("fatal: failed to link `{}`", output);
+
+ std::process::exit(1);
+ }
+ ok => ok,
+ },
Ok(Command::Usage) => {
println!("{}", usage);
std::process::exit(exitcode::OK);
diff --git a/tamer/src/ir/asg/mod.rs b/tamer/src/ir/asg/mod.rs
index a547463..2d9bd4d 100644
--- a/tamer/src/ir/asg/mod.rs
+++ b/tamer/src/ir/asg/mod.rs
@@ -76,8 +76,8 @@
//! let identa_sym = interner.intern("identa");
//! let identb_sym = interner.intern("identb");
//!
-//! let identa = asg.declare(identa_sym, IdentKind::Meta, Source::default())?;
-//! let identb = asg.declare_extern(identb_sym, IdentKind::Meta)?;
+//! let identa = asg.declare(identa_sym, IdentKind::Meta, Some(Source::default()))?;
+//! let identb = asg.declare(identb_sym, IdentKind::Meta, None)?;
//!
//! assert_eq!(
//! Some(&IdentObject::Extern(identb_sym, IdentKind::Meta)),