Show Output Formatters¶
cliff is delivered with output formatters for show
commands. ShowOne adds a command line switch to let the user
specify the formatter they want, so you don’t have to do any extra
work in your application.
html¶
The html formatter uses tablib to produce HTML output as a table.
(.venv)$ cliffdemo file -f html setup.py
<table>
<thead>
<tr><th>Field</th>
<th>Value</th></tr>
</thead>
<tr><td>Name</td>
<td>setup.py</td></tr>
<tr><td>Size</td>
<td>6373</td></tr>
<tr><td>UID</td>
<td>527</td></tr>
<tr><td>GID</td>
<td>501</td></tr>
<tr><td>Modified Time</td>
<td>1336353173.0</td></tr>
</table>