scanner: support alternative output formats
Right now the only output format from the scan option is a text tree structure, so it would be nice to have different output formats like json or xml to parse the result.
Migrated from T2298 (view on Phabricator)