danielgtaylor / aglio

An API Blueprint renderer with theme support that outputs static HTML
4.75k stars 480 forks source link

CLI: exit process with correct error code #303

Open aledeg opened 7 years ago

aledeg commented 7 years ago

I've seen that there is already a resolved ticket (#38) about that issue. But it seems that when I have warnings during the generation, the return code is 0.

Here is the launched command:

aglio --theme flatly --theme-template index.jade --theme-full-width true -i book.apib -o book.html

Am I missing something?

aledeg commented 7 years ago

If I redirect stderr to a file, I get all errors and warnings in that file. That means that there is an unconsitency between the output and the exit code. As a workaround, I output every error and warning messages to a file and test the file.

jackbentley commented 7 years ago

A warning message isn't an error, though? So it shouldn't affect the exit code? A non-zero exit code would be considered an error.

aledeg commented 7 years ago

I agree that a warning is not an error, but there should be something to differentiate a process that works flawlessly and one with warnings. Maybe a switch to convert warnings to errors.