The __main__ debug printer crashes with a bare IndexError when no
file argument is given, and json.dumps() crashes on YAML values that
have no JSON representation, such as dates.
Check the argument count and print a usage message, and pass
default = str to json.dumps() so that non-JSON values are rendered
as strings instead of aborting the dump.
Assisted-by: unsloth/Qwen3.8-27B-GGUF:Q4_K_M with pi.dev v0.84.2
Signed-off-by: Jan Lindemann <jan@janware.com>