Background: The default for phabfive diffusion list is to print the name field.
Objective: Allow to specify fields of interest. An example:
phabfive diffusion list --fields name,url,type
Where the fields could map directly to data returned by the Phabricator API, but not necessarily, for example the url field would have to be assembled from various data from the API.
name -- same as repository['fields']['name']
url -- built from the above name plus a prefix and suffix
type -- same as repository['fields']['vcs']
The output would be something similar to this:
$ phabfive diffusion list --fields url,type
ssh://dynamist@vault.phacility.com/source/phabfive.git,git
ssh://dynamist@vault.phacility.com/source/unifik.git,git
For now we will focus on CSV compliant output, JSON and/or YAML is not in scope.
(This section was suggested by @rholmboe)
OpenStack actually perfected it imho
This is the default output in the cli, which is for all modules (network, server, floating etc etc)
(openstack) $ git:(master) openstack network list -f table
+--------------------------------------+---------+----------------------------------------------------------------------------+
| ID | Name | Subnets |
+--------------------------------------+---------+----------------------------------------------------------------------------+
| 42f2071d-273f-4445-b981-dd05776422ed | private | ae7bdddb-5c99-46f8-bab1-25efab1cba42 |
| 7b6935ef-4a13-41d1-b8fa-087927cb480b | public | 1993b658-8cf1-421a-a93f-e2de7b5dd06a, 5151480f-ae04-4619-b36f-3bdcc4de5342 |
+--------------------------------------+---------+----------------------------------------------------------------------------+
(openstack) $ git:(master) openstack network list -c ID -f value
42f2071d-273f-4445-b981-dd05776422ed
7b6935ef-4a13-41d1-b8fa-087927cb480b
From the helper
output formatters:
output formatter options
-f {csv,json,table,value,yaml}, --format {csv,json,table,value,yaml}
the output format, defaults to table
-c COLUMN, --column COLUMN
specify the column(s) to include, can be repeated
--sort-column SORT_COLUMN
specify the column(s) to sort the data (columns
specified first have a priority, non-existing columns
are ignored), can be repeated
Proposed Functionality
Background: The default for phabfive diffusion list is to print the name field.
Objective: Allow to specify fields of interest. An example:
phabfive diffusion list --fields name,url,type
Where the fields could map directly to data returned by the Phabricator API, but not necessarily, for example the url field would have to be assembled from various data from the API.
The output would be something similar to this:
For now we will focus on CSV compliant output, JSON and/or YAML is not in scope.
(This section was suggested by @rholmboe)
OpenStack actually perfected it imho
This is the default output in the cli, which is for all modules (network, server, floating etc etc)
in yaml
in csv
in json
Just the values
From the helper