This adds support for conditional output.
Merge pull request #238 from partnuz/patch-2

This adds support for conditional output. Thanks @partnuz