Add support for --output option from plugin

This time without introducing weird behaviours.