Open MetricMike opened 3 years ago
Hey @MetricMike thanks for proposing this and volunteering to work on it. There's a lot of background to improving the terminal output. I will link here and encourage you to read before working on this.
column
was previously added and removed as we cannot assume it is available on all machines:
column
: https://github.com/asdf-vm/asdf/pull/721Wrap terminal line outputs to 80 chars (https://github.com/asdf-vm/asdf/issues/646). This issue discusses:
--porcelain
flag for scripts to consume (removing their reliance on the current output allowing use to develop that with a user focus)--less
or --more
on command output for users, particularly those that output a lot of information (like asdf plugin list --urls
or asdf plugin list --refs --urls
, see the expandable section https://github.com/asdf-vm/asdf/issues/646#issuecomment-645227580)The current implementation of asdf current
uses printf
with min padding on each col.
Knowing the max beforehand is difficult (not impossible obviously because column
does its magic) and ultimately letting the terminal perform wrapping seems like the best option. Knowing what width is acceptable to the user and how to output accordingly is difficult as I am sure you can see.
Finally, a solution I (few have chimed in here) would like to see is one which we can apply everywhere:
printf
may be acceptable
$ asdf current
awscli ______ No version set. Run "asdf <global|shell|local> awscli <version>"
dotnet-core 5.0.102 /home/metricmike/.tool-versions
golang 1.15.8 /home/metricmike/.tool-versions
gradle 7.0-milestone-1 /home/metricmike/.tool-versions
java corretto-11.0.. /home/metricmike/.tool-versions
maven 3.6.3 /home/metricmike/.tool-versions
Is your feature request related to a problem? Please describe.
Some projects (hi, java!) use names that cause some overflow on the
asdf current
command.Describe the solution you'd like
asdf current
should set its columns dynamically based on the plugins it's going to outputAdditional context
Happy to work on this myself, this issue is mostly a placeholder for me :)