Storyyeller / Krakatau

Java decompiler, assembler, and disassembler
GNU General Public License v3.0
1.95k stars 219 forks source link

exit(1) in case of error in the assembler / disassembler ? #116

Closed lemonsqueeze closed 7 years ago

lemonsqueeze commented 7 years ago

Hi,

I noticed the assembler exits with status 0 even in case of error:

$ echo garbage > foo.j
$ assemble.py foo.j
foo.j:1:1: error: Expected '.class' or '.version'.
$ echo $?
0

Maybe we could return non-zero to indicate error ? This would be useful for external tools. For example I have a Makefile rule for assembling .j files, would let make know right away when something fails.

Thanks for writing krakatau, awesome work

Storyyeller commented 7 years ago

Couldn't you just tell by the fact that there is output on stderr? Anyway, I'll look into it.

lemonsqueeze commented 7 years ago

Usually no problem, but when assembling a thousand classes it's easy to miss one...

Storyyeller commented 7 years ago

Should work now.