Handle `--format=json` by printing data as JSON