add --format option and HTML output support