Give the user a choice of YAML or JSON output for all commands that emit either format. I have left the default format as YAML.
I have also removed the Entry: 123 output lines which seemed like they were intended for debugging. I'm happy to be wrong here and restore them (for YAML output only, as it's clearly incompatible with JSON).
As-implemented, this will break scripted usage for the below commands that default to JSON. Given the breakdown of YAML vs. JSON usage here I think this is the least-bad option.
The other options I considered were:
default to JSON (break most usage)
default to nothing and require a flag (break everyone's usage)
have a third 'auto' state that maintained the current behaviour (breaks rule of least surprise)
Commands emitting JSON (with this change they will emit YAML):
Give the user a choice of YAML or JSON output for all commands that emit either format. I have left the default format as YAML.
I have also removed the
Entry: 123
output lines which seemed like they were intended for debugging. I'm happy to be wrong here and restore them (for YAML output only, as it's clearly incompatible with JSON).As-implemented, this will break scripted usage for the below commands that default to JSON. Given the breakdown of YAML vs. JSON usage here I think this is the least-bad option.
The other options I considered were:
Commands emitting JSON (with this change they will emit YAML):
Commands emitting YAML: