Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Output for creation is unreadable #191

Closed
MoOx opened this issue Apr 8, 2016 · 5 comments
Closed

Output for creation is unreadable #191

MoOx opened this issue Apr 8, 2016 · 5 comments

Comments

@MoOx
Copy link

MoOx commented Apr 8, 2016

I just created a repo using gitlab create_project NAME.

Here is the output

❯ gitlab create_project "jsx-test-helpers"
+----------+------------+----------------+--------------------------+------------+----------------+-------------+-------------+----------------------------------------------+---------+----------------+--------------------------+------------------------+------------------+------------------------------------+-----------+-------------------+-------+------------------+-----------------------+--------+---------------+----------------------+------------------------+------------------+------------------------------------------+------------+----------+------------------+------------------------------------------+--------------+
|                                                                                                                                                                                                                                                                                                      Gitlab.create_project jsx-test-helpers                                                                                                                                                                                                                                                                                                      |
+----------+------------+----------------+--------------------------+------------+----------------+-------------+-------------+----------------------------------------------+---------+----------------+--------------------------+------------------------+------------------+------------------------------------+-----------+-------------------+-------+------------------+-----------------------+--------+---------------+----------------------+------------------------+------------------+------------------------------------------+------------+----------+------------------+------------------------------------------+--------------+
| archived | avatar_url | builds_enabled | created_at               | creator_id | default_branch | description | forks_count | http_url_to_repo                             | id      | issues_enabled | last_activity_at         | merge_requests_enabled | name             | name_with_namespace                | namespace | open_issues_count | owner | path             | path_with_namespace   | public | public_builds | runners_token        | shared_runners_enabled | snippets_enabled | ssh_url_to_repo                          | star_count | tag_list | visibility_level | web_url                                  | wiki_enabled |
+----------+------------+----------------+--------------------------+------------+----------------+-------------+-------------+----------------------------------------------+---------+----------------+--------------------------+------------------------+------------------+------------------------------------+-----------+-------------------+-------+------------------+-----------------------+--------+---------------+----------------------+------------------------+------------------+------------------------------------------+------------+----------+------------------+------------------------------------------+--------------+
| false    | null       | true           | 2016-04-08T07:33:47.877Z | 388578     | null           | null        | 0           | https://gitlab.com/MoOx/jsx-test-helpers.git | 1049329 | true           | 2016-04-08T07:33:50.479Z | true                   | jsx-test-helpers | Maxime Thirouin / jsx-test-helpers | Hash      | 0                 | Hash  | jsx-test-helpers | MoOx/jsx-test-helpers | false  | true          | ******************** | true                   | false            | git@gitlab.com:MoOx/jsx-test-helpers.git | 0          | []       | 0                | https://gitlab.com/MoOx/jsx-test-helpers | true         |
+----------+------------+----------------+--------------------------+------------+----------------+-------------+-------------+----------------------------------------------+---------+----------------+--------------------------+------------------------+------------------+------------------------------------+-----------+-------------------+-------+------------------+-----------------------+--------+---------------+----------------------+------------------------+------------------+------------------------------------------+------------+----------+------------------+------------------------------------------+--------------+

As you can see, in raw text, it's ok. But In my terminal, it's unreadable.
screen shot 2016-04-08 at 09 40 03

@iainsmith
Copy link

Does anyone know if there is a nice way to deal with this in terminal-table?

If not, it's we could abbreviate (or maybe omit) some columns.

  • created_at, updated_at, last_activity_at could all be abbreviated to relative dates "1 day ago" or completely omitted
  • name is redundant compared to name_with_namespace
  • Columns that are all entirely null could also be omitted.

If we omit some fields by default it would be good to add a verbose flag.

@gligoran
Copy link

gligoran commented Jun 19, 2016

You can use the --only switch to get something like this:

gitlab create_project test --only=id,name,ssh_url_to_repo
+---------+------+----------------------------------+
| Gitlab.create_project test, --only=id,name,ssh_url_to_repo |
+---------+------+----------------------------------+
| id      | name | ssh_url_to_repo                  |
+---------+------+----------------------------------+
| 13***** | test | git@gitlab.com:********/test.git |
+---------+------+----------------------------------+

What would really be awesome is the ability to get raw data, so you could pipe it further. For example to pipe the ssh_url_to_repo directly into a git remote add origin.

@Nakilon
Copy link

Nakilon commented Jun 20, 2016

Maybe transpose?

@asedge
Copy link
Collaborator

asedge commented Jun 20, 2016

@gligoran you can use --json to get fairly close to raw data and then use the jq tool to parse out only the field you want. Kind of like this:

$ gitlab projects '{per_page: 1}' --json | jq '.result[].ssh_url_to_repo'
"git@git.example.org:foo/dockerfiles.git"

@asedge asedge closed this as completed Jul 6, 2017
@asedge
Copy link
Collaborator

asedge commented Jul 6, 2017

Terminal table is kind of ugly, sorry. I suggested using --json and parsing with jq. Hopefully you found something worth your while.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants