From 3379b5dcffcf6481e9a1c2a742ba4f99798c0e24 Mon Sep 17 00:00:00 2001
From: Per Lindgren <per.lindgren@ltu.se>
Date: Sat, 17 Nov 2018 06:29:47 +0100
Subject: [PATCH] beta release (docs/debug out in bad shape)

---
 src/main.rs | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/src/main.rs b/src/main.rs
index e60a45e..cad1b8b 100644
--- a/src/main.rs
+++ b/src/main.rs
@@ -178,7 +178,7 @@ fn parse_callgraph(hm: &mut HashMap<String, NodeIndex<u32>>, g: &mut Graph<Node,
 }
 
 fn main() {
-    println!("start sub command");
+    eprintln!("start sub command");
     // first argument is the path to this binary; the second argument is always "call-stack" -- both can
     // be ignored
     let args = env::args().skip(2).collect::<Vec<_>>();
@@ -231,7 +231,7 @@ fn main() {
     }
 
     let out = parse_out(str::from_utf8(&output).unwrap());
-    println!("{:?}", out);
+    eprintln!("{:?}", out);
 
     use std::fmt::Write;
     let mut s = String::new();
@@ -246,7 +246,7 @@ fn main() {
 
     let mut ir = s.clone();
     write!(&mut ir, ".ll").expect("internal error");
-    println!("s: {}", ir);
+    eprintln!("s: {}", ir);
 
     let mut c = Command::new("opt");
     c.arg("-analyze")
@@ -256,22 +256,22 @@ fn main() {
         .expect("failed to execute process");
     let dump = c.output().expect("failed to execute process");
 
-    println!("\nstatus: {:?}", dump.status);
-    println!("\nstdout: {:?}", str::from_utf8(&dump.stdout).unwrap());
-    println!("\nstderr: {:?}", str::from_utf8(&dump.stderr).unwrap());
+    eprintln!("\nstatus: {:?}", dump.status);
+    eprintln!("\nstdout: {:?}", str::from_utf8(&dump.stdout).unwrap());
+    eprintln!("\nstderr: {:?}", str::from_utf8(&dump.stderr).unwrap());
 
     let mut g = Graph::<_, ()>::new();
     let mut hm = HashMap::new();
 
     let mut buffer = Vec::new();
-    println!("elf = {}", &s);
+    eprintln!("elf = {}", &s);
 
     parse_elf(&mut hm, &mut g, &s, &mut buffer);
 
     parse_callgraph(&mut hm, &mut g, &str::from_utf8(&dump.stderr).unwrap());
 
     if is_cyclic_directed(&g) {
-        println!("/* warning, cyclic graph */");
+        eprintln!("Warning, cyclic graph ");
     }
 
     let mut v = Vec::new();
-- 
GitLab