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

Set column width for tabular output format #270

Open
glcardoz opened this issue Dec 19, 2022 · 1 comment
Open

Set column width for tabular output format #270

glcardoz opened this issue Dec 19, 2022 · 1 comment

Comments

@glcardoz
Copy link

glcardoz commented Dec 19, 2022

I am adding some code to an Azure extension and need to display a 130 character long hexadecimals string.
Azure CLI uses Knack which in turn uses the 'tabulate' library to print the table output format in the terminals.
Tabulate provides a maxcolwidths argument which specifies the max width for it's respective column. However, knack does not use this argument, nor does it provide a way to configure this.

I have a 130-character hexadecimal string which needs to be displayed in tabular format. However, since knack does not specify the column width, the table outputs is not easily readable on a smaller size terminal.
image

I am looking for something like this (test code and I set the maxcolwdiths argument to 30 here)

  Length  Value
--------  ------------------------------
     130  1234567890ABCDEF1234567890ABCD
          EF1234567890ABCDEF1234567890AB
          CDEF1234567890ABCDEF1234567890
          ABCDEF1234567890ABCDEF12345678
          90ABCDEF
     130  1234567890ABCDEF1234567890ABCD
          EF1234567890ABCDEF1234567890AB
          CDEF1234567890ABCDEF1234567890
          ABCDEF1234567890ABCDEF12345678
          90ABCDEF
      10  1234567890

Is there any way that knack provides to configure the maxcolwidths argument from Azure CLI?

@ee99ee
Copy link

ee99ee commented Jan 2, 2023

+1 for this request

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

2 participants