Add comment to DumpCommand. Only close writer if not null.