Skip to content

feat: Implement plain and table output #142

Description

@NickLarsenNZ

I'm wondering if we should rename the output type for plain to table.

stackablectl stacklet list --help

...

  -o, --output <OUTPUT_TYPE>
          [default: plain]

          Possible values:
          - plain: Print output formatted as plain text
          - json:  Print output formatted as JSON
          - yaml:  Print output formatted as YAML

I would expect plain to print out text with no decorations.

I discovered this because I was trying to find a way to print out the stacklet URLs without them breaking when my terminal width is small:

image

My workaround was to use --output=yaml to get unbroken clickable links in the terminal.

Activity

  1. fhennig commented on Nov 14, 2023

    @fhennig
    Contributor

    "table" seems more appropriate 👍

    maybe the "plain" setting could print a column layout without decorations and ignoring terminal width, similar to how kubectl prints it

  2. changed the title [-]cli output type plain means table[/-] [+]feat: Implement `plain` and `table` output[/+] on Nov 21, 2023
  3. moved this from Next to Development: In Progress in Stackable Engineeringon Dec 14, 2023
  4. NickLarsenNZ commented on Dec 15, 2023

    @NickLarsenNZ
    MemberAuthor

    I can make it look like this by just disabling the arrangement (ignoring terminal width) and table border characters.

     PRODUCT   NAME      NAMESPACE  ENDPOINTS                                   CONDITIONS                      
     opa       opa       default                                                Available, Reconciling, Running 
     superset  superset  default    external-http http://172.18.0.2:30232       Available, Reconciling, Running 
     trino     trino     default    coordinator-metrics 172.18.0.2:30392        Available, Reconciling, Running 
                                    coordinator-https https://172.18.0.2:30416   
    

    If the terminal is narrow, the text will wrap like so:

     PRODUCT   NAME      NAMESPACE  ENDPOINTS                                   CO
    NDITIONS                      
     opa       opa       default                                                Av
    ailable, Reconciling, Running 
     superset  superset  default    external-http http://172.18.0.2:30232       Av
    ailable, Reconciling, Running 
     trino     trino     default    coordinator-metrics 172.18.0.2:30392        Av
    ailable, Reconciling, Running 
                                    coordinator-https https://172.18.0.2:30416   
    

    I have also removed the padding between the endpoint name and URL in the plain output.

    Some of the other commands output a lot of blank lines, so I need to look into the cause of that (it appears to be from descriptions). Some commands don't allow different output (like cache list) so I'm working on that too.

  5. moved this from Development: In Progress to Development: Done in Stackable Engineeringon Dec 18, 2023
  6. moved this from Development: Done to Done in Stackable Engineeringon Dec 21, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions