Просмотр исходного кода

zkas: Add --examine flag to inspect decoded bytecode.

parazyd 4 лет назад
Родитель
Сommit
91fb01ec7b
1 измененных файлов с 8 добавлено и 2 удалено
  1. 8 2
      zkas/src/main.rs

+ 8 - 2
zkas/src/main.rs

@@ -24,6 +24,10 @@ struct Cli {
     #[clap(short)]
     #[clap(short)]
     evaluate: bool,
     evaluate: bool,
 
 
+    /// Examine decoded bytecode
+    #[clap(long)]
+    examine: bool,
+
     /// ZK script to compile
     /// ZK script to compile
     input: String,
     input: String,
 }
 }
@@ -74,8 +78,10 @@ fn main() -> Result<()> {
     file.write_all(&bincode)?;
     file.write_all(&bincode)?;
     println!("Wrote output to {}", &output);
     println!("Wrote output to {}", &output);
 
 
-    let zkbin = ZkBinary::decode(&bincode)?;
-    println!("{:#?}", zkbin);
+    if cli.examine {
+        let zkbin = ZkBinary::decode(&bincode)?;
+        println!("{:#?}", zkbin);
+    }
 
 
     Ok(())
     Ok(())
 }
 }