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

[Improvement]: --raw parameter for commands that print tables #1315

Closed
1 task done
jonaro00 opened this issue Oct 11, 2023 · 3 comments · Fixed by #1319
Closed
1 task done

[Improvement]: --raw parameter for commands that print tables #1315

jonaro00 opened this issue Oct 11, 2023 · 3 comments · Fixed by #1319
Labels
Contribution Wanted The community is welcome to collaborate on this issue Good First Issue Good for newcomers S-Accepted This will be worked on T-Improvement Improvement or addition to existing features

Comments

@jonaro00
Copy link
Member

jonaro00 commented Oct 11, 2023

Describe the improvement

Currently, the commands cargo shuttle project list and cargo shuttle deployment list show their output in unicode character tables.
image

This can be annoying when scripting or when trying to copy a value on a narrow terminal.
The task is to add a --raw flag to these commands that prints the tables with space-aligned columns, similar to docker ps. An important difference is that the cell width should not be affected by terminal width.

[Bonus task (super easy)]: Change the default value of project list's limit argument to 15.

Duplicate declaration

  • I have searched the issues and this improvement has not been requested before.
@jonaro00 jonaro00 added T-Improvement Improvement or addition to existing features Good First Issue Good for newcomers Contribution Wanted The community is welcome to collaborate on this issue S-Accepted This will be worked on labels Oct 11, 2023
@reubenwong97
Copy link

Could you provide an example of the output desired? Just want to be clear on what this space-aligned table would look like.

@supleed2
Copy link
Contributor

The docker ps example in the docker docs looks like this:

docker ps --no-trunc

CONTAINER ID                                                     IMAGE                        COMMAND                CREATED              STATUS              PORTS               NAMES
ca5534a51dd04bbcebe9b23ba05f389466cf0c190f1f8f182d7eea92a9671d00 ubuntu:22.04                 bash                   17 seconds ago       Up 16 seconds       3300-3310/tcp       webapp
9ca9747b233100676a48cc7806131586213fa5dab86dd1972d6a8732e3a84a4d crosbymichael/redis:latest   /redis-server --dir    33 minutes ago       Up 33 minutes       6379/tcp            redis,webapp/db

Ignoring any width info from the terminal. I guess it would look similar with the terminal wrapping the output and no escape codes (colouring) so that it's easier to work with, eg. piping to other commands.

@supleed2
Copy link
Contributor

I have a working version of this because I got distracted when I got stuck on #962. I'll open a draft PR for now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Contribution Wanted The community is welcome to collaborate on this issue Good First Issue Good for newcomers S-Accepted This will be worked on T-Improvement Improvement or addition to existing features
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants