Add documentation for the value formatter

Change-Id: I46a0f4cb74a689d1c14f1c538268433c687a5d01
This commit is contained in:
TerryHowe 2015-04-14 12:43:53 -06:00
parent 442c4d7eb7
commit 6d292000aa
1 changed files with 29 additions and 15 deletions

View File

@ -28,6 +28,27 @@ commands. :class:`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.
table
-----
The ``table`` formatter uses PrettyTable_ to produce output
formatted for human consumption. This is the default formatter.
.. _PrettyTable: http://code.google.com/p/prettytable/
::
(.venv)$ cliffdemo file setup.py
+---------------+--------------+
| Field | Value |
+---------------+--------------+
| Name | setup.py |
| Size | 5825 |
| UID | 502 |
| GID | 20 |
| Modified Time | 1335569964.0 |
+---------------+--------------+
shell
-----
@ -48,26 +69,19 @@ parsing overhead in shell scripts.
(.venv)$ echo $example_size
5916
table
value
-----
The ``table`` formatter uses PrettyTable_ to produce output
formatted for human consumption.
.. _PrettyTable: http://code.google.com/p/prettytable/
The ``value`` formatter produces output that only contains the
value of the field or fields.
::
(.venv)$ cliffdemo file setup.py
+---------------+--------------+
| Field | Value |
+---------------+--------------+
| Name | setup.py |
| Size | 5825 |
| UID | 502 |
| GID | 20 |
| Modified Time | 1335569964.0 |
+---------------+--------------+
(.venv)$ cliffdemo file -f value -c Size setup.py
5916
(.venv)$ SIZE="$(cliffdemo file -f value -c Size setup.py)"
(.venv)$ echo $SIZE
5916
Other Formatters
----------------