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

help util: replace jtextutils with asciitable #415

Merged
merged 3 commits into from
Feb 6, 2024

Conversation

mpollmeier
Copy link
Contributor

  • main motivation: jtextutils became vulnerable because the domain
    com.massisframework is available for sale...
  • also: asciitable is better IMO

* main motivation: jtextutils became vulnerable because the domain `com.massisframework` is available for sale...
* also: asciitable is far better IMO
@mpollmeier mpollmeier requested a review from maltek February 6, 2024 11:03
@mpollmeier
Copy link
Contributor Author

cc @Ferada

table.addRule()
table.getContext.setGridTheme(TA_GridThemes.FULL)
table.setTextAlignment(TextAlignment.LEFT)
table.render(width)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what happens when the contents are wider than 120 characters? (e.g. dataflows are wider than that all the time)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It get's split up into several lines. There's quite a few options, I went for left alignment for the text.
https://github.com/vdmeer/asciitable/?tab=readme-ov-file#text-alignment-1

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

(previously, the table would just expand in width to the widest cell)

@mpollmeier
Copy link
Contributor Author

For comparison: in joern:
old:
image
image

new:
image
image

@mpollmeier
Copy link
Contributor Author

n.b. I'm working on a followup change that'll pass down the terminal size to the text table

Copy link
Contributor

@maltek maltek left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ok, that does look nicer 👍

@mpollmeier mpollmeier merged commit ad8bec6 into master Feb 6, 2024
1 check passed
@delete-merged-branch delete-merged-branch bot deleted the michael/rip-texttable branch February 6, 2024 11:52
@Ferada
Copy link
Member

Ferada commented Feb 6, 2024

Thanks for looking into that 👍

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

Successfully merging this pull request may close these issues.

3 participants