-
Notifications
You must be signed in to change notification settings - Fork 782
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
fix: remove column
command in favor of awk
#721
Conversation
It looks like one of the tests failed because of the change in command output. Can you correct the failing test? |
64e31ed
to
a1ba952
Compare
Why not just get rid of |
Column has an advantage in auto-sizing the first column. Awk just has a hardcoded size for the first column. I can remove the column call if you prefer. |
After looking into many options for this solution, I think we should remove Adding deps to If the content changes to require further modifications to column padding it shouldn't be too difficult to update. Annoying, yes, but less so than getting all users and systems to rely on another dep. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pending input from @Stratus3D I would like to see column
removed.
Though I am happy to see this get merged as a stopgap if we require a longer discussion around dependencies.
Print aligned columns without non-posix column command
Handle missing non-posix column command gracefully
b99a0cf
to
b911ca4
Compare
@jthegedus Thanks for the feedback, I've removed the |
@Stratus3D are we okay with merging this, and then having a follow-up PR that addresses converting all other tabular output to |
@@ -20,7 +20,7 @@ plugin_list_all_command() { | |||
|
|||
printf "%s\\t%s\\n" "$index_plugin_name" "$installed_flag$source_url" | |||
done | |||
) | column -t -s $'\t' | |||
) | awk '{ printf("%-28s", $1); sub(/^[^*]/, " &", $2); $1=""; print $0 }' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why do these two awk commands differ? The column
commands they replace are the same.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This one:
- prints the first column at 28 char width, left-aligned
- Adds a space to column 2's without leading "*" for alignment
28-chars-wide next-column
28-chars-wide *column-with-asterisk
The other one just prints the first column at 28 char width, left-aligned
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Unsure why the awk commands are different. I think the command should be the same in both cases. Otherwise these changes look good to me.
Note to whoever merges: probably best to squash and merge this PR. |
@jthegedus Are your change requests addressed or do you have further requests? |
@homburg You've addressed them, was just waiting to see your response to @Stratus3D 's questions. LGTM too, will merge |
column
commandcolumn
command in favor of awk
Avoid hard dependency on
column
command. This commandis not included in a fresh ubuntu container and not
defined in posix:
https://pubs.opengroup.org/onlinepubs/9699919799/idx/utilities.html
Also makes the output of
asdf plugin list all
line-streamedon the second column value