ceph/ceph — pull request #2728 by apeters1971 (2014-10-15 13:26:40+00:00)
Title: Wip table formatter

Adds a new format style for interactive shell commands and shell scripting providing an auto-sizing table format and parsable key-value table format.

The request is split into two commits. The first is the pure add-on in Formatter.cc/h, the second cleans-up the original (non-)formatting of the source files. I am not sure you want this, I can remove it.

The unit test demonstrates the usage of the formatting styles.

An example output looks like this:
```
+---------+----------+----------------+---------+--------------------------+
| osd-id | pg-seed | ip | state | host:name[0] |
+---------+----------+----------------+---------+--------------------------+
| 231 | 180 | 12X.14Y.2Z.40 | active | p0515111352588.example.com |
| 64 | 180 | 12X.14Y.2Z.44 | active | p0515111357605.example.com |
| 107 | 180 | 12X.14Y.2Z.51 | active | p0515111356199.example.com |
+---------+----------+----------------+---------+--------------------------+
```
And the easy parsing format looks like this
```
key::osd-id="231" key::pg-seed="180" key::ip="12X.14Y.2Z.40" key::state="active" key::host:name[0]="p0515111352588.example.com"
key::osd-id="64" key::pg-seed="180" key::ip="12X.14Y.2Z.44" key::state="active" key::host:name[1]="p0515111357605.example.com"
key::osd-id="107" key::pg-seed="180" key::ip="12X.14Y.2Z.51" key::state="active" key::host:name[2]="p0515111356199.example.com"
```