result is an integer representing the exit code of a command line process that was run via Groovy code. An exit code of 0 means the process was successful and an exit code from 1-255 means a failure. Then this line is executed:
println result ? "The command failed." : "The command succeeded."
What's happening here is that
result is being coerced to a boolean (nonzero is true, zero is false) and then the ternary operator is used to determine which message to print, telling the user if the command succeeded or failed.
Is this fine in the context of the Groovy language, or is this going a bit too far with implicit magic?