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

allow setting maximum column width (feature req) #253

Open
bbrendon opened this issue May 26, 2019 · 6 comments · May be fixed by #307
Open

allow setting maximum column width (feature req) #253

bbrendon opened this issue May 26, 2019 · 6 comments · May be fixed by #307
Labels

Comments

@bbrendon
Copy link

It would be nice to disable the wrapping of the output when using commands such as hass-cli state list. An option like "max-width" or something similar would be nice. I tried a bunch of the "table-format" options but couldn't find anything to limit the width of the columns and prevent wrapping.

The main reason for this is the 'state list' output is hard to read with the wrapping.

I suppose I could do something like : hass-cli state list | cut -c -170 , but that's too much typing :)

@maxandersen
Copy link
Contributor

I agree it's not optimal but not something I have an easy fix for. The tabulate library used to print don't have width/formatting built-in.

Might need to move to something different to accommodate. Ideas welcome!

@maxandersen
Copy link
Contributor

Actually, a hacky fix could be to do an abrupt line cut similar to your cut example and expose as a flag option.

@bbrendon
Copy link
Author

Probably should be a separate issue but would be nice to maybe use an env var to save some default settings like export HASSCLI_OPT= . That way I don't have to type |sort and I can use the built in sort feature easier. Or maybe just change the code to sort the state list by default.

@bbrendon
Copy link
Author

bbrendon commented May 27, 2019

Or a hack that fixes everything without patching the source? :)

hcli_func() {
    hass-cli   "$@" | cut -c -160 | sort		
}
alias hass-cli=hcli_func

@maxandersen
Copy link
Contributor

:) do open seperste issue for sorting. That one is fairly trivial to do.

Support for environment variables and a config file I want too.

@stale
Copy link

stale bot commented Jul 26, 2019

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the wontfix label Jul 26, 2019
@stale stale bot closed this as completed Aug 2, 2019
@maxandersen maxandersen reopened this Aug 30, 2019
@stale stale bot removed the wontfix label Aug 30, 2019
jm66 added a commit to jm66/home-assistant-cli that referenced this issue Oct 15, 2019
- If specified --columns-width or HASS_COL_WIDTH env var
  truncates column values
- Uses default const.COLUMNS_WIDTH_STR
- Fixes home-assistant-ecosystem#253
jm66 added a commit to jm66/home-assistant-cli that referenced this issue Oct 16, 2019
- If specified --columns-width or HASS_COL_WIDTH env var
  truncates column values
- Uses default const.COLUMNS_WIDTH_STR
- Fixes home-assistant-ecosystem#253
jm66 added a commit to jm66/home-assistant-cli that referenced this issue Oct 16, 2019
- If specified --columns-width or HASS_COL_WIDTH env var
  truncates column values
- Uses default const.COLUMNS_WIDTH_STR
- Fixes home-assistant-ecosystem#253
@jm66 jm66 linked a pull request Oct 16, 2019 that will close this issue
maxandersen pushed a commit to jm66/home-assistant-cli that referenced this issue Nov 17, 2019
- If specified --columns-width or HASS_COL_WIDTH env var
  truncates column values
- Uses default const.COLUMNS_WIDTH_STR
- Fixes home-assistant-ecosystem#253
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
2 participants