diff options
Diffstat (limited to 'docs')
-rw-r--r-- | docs/source/list_commands.rst | 64 |
1 files changed, 60 insertions, 4 deletions
diff --git a/docs/source/list_commands.rst b/docs/source/list_commands.rst index 2dbf748..fbca699 100644 --- a/docs/source/list_commands.rst +++ b/docs/source/list_commands.rst @@ -43,11 +43,23 @@ further manipulation. "Makefile",5569 "source",408 -PrettyTable ------------ +json +---- -The ``PrettyTable`` formatter uses PrettyTable_ to produce output -formatted for human consumption. +The ``json`` formatter uses tablib_ to produce JSON output. + +:: + + (.venv)$ cliffdemo files -f json + [{"Name": "build", "Size": 136}, {"Name": "cliffdemo.log", "Size": + 3461}, {"Name": "Makefile", "Size": 5569}, {"Name": + "requirements.txt", "Size": 33}, {"Name": "source", "Size": 782}] + +table +----- + +The ``table`` formatter uses PrettyTable_ to produce output formatted +for human consumption. .. _PrettyTable: http://code.google.com/p/prettytable/ @@ -63,6 +75,50 @@ formatted for human consumption. | source | 408 | +---------------+------+ +yaml +---- + +The ``yaml`` formatter uses tablib_ to produce YAML output as a +sequence of mappings. + +:: + + (.venv)$ cliffdemo files -f yaml + - {Name: build, Size: 136} + - {Name: cliffdemo.log, Size: 3043} + - {Name: Makefile, Size: 5569} + - {Name: requirements.txt, Size: 33} + - {Name: source, Size: 816} + +.. _tablib: https://github.com/kennethreitz/tablib + + +html +---- + +The ``html`` formatter uses tablib_ to produce HTML output as a +sequence of mappings. + +:: + + (.venv)$ cliffdemo files -f html + <table> + <thead> + <tr><th>Name</th> + <th>Size</th></tr> + </thead> + <tr><td>build</td> + <td>136</td></tr> + <tr><td>cliffdemo.log</td> + <td>3252</td></tr> + <tr><td>Makefile</td> + <td>5569</td></tr> + <tr><td>requirements.txt</td> + <td>33</td></tr> + <tr><td>source</td> + <td>782</td></tr> + </table> + Creating Your Own Formatter --------------------------- |