If only --ids are requested, we don't need to do anything else
Simplify the code to generate CSV and JSON output by typecasting. Feels a little dirty, but no harm no fowl.