reference Flags

--html

Accepted by
opengrep show
See also
opengrep show, --json

Wraps the output of opengrep show in an HTML page, with the tree indented and styled for a browser. The flag applies to the dump-* kinds. Kinds that print plain text, such as version and supported-languages, ignore it. The format of the dumps is not stable.

Examples

A pattern dump as a page

Command and result
$ opengrep show --html dump-pattern python 'eval(...)' | grep -c '<html>'
1
$ opengrep show dump-pattern python 'eval(...)' | grep -c '<html>'
0

The second command prints the same tree as text, so it holds no <html> tag.