Skip to content

[Enhancement / Proposal to gem on the commandline] Change the format output of "gem list" #5442

@rubyFeedback

Description

@rubyFeedback

When you currently do issue this:

gem list

You get output like that:

yaml (default: 0.2.0)
zeitwerk (2.5.4)
zlib (default: 2.1.1)

First, I think it is confusing that some gems are listed via "default:" and others not. Only the version number should be displayed, but this is an aside.

If you use python pip and do "pip list", you get something similar:

Package     Version
----------- ---------
asciimatics 1.13.0
future      0.18.2
Jinja2      3.1.1

I would like to propose that "gem list" also uses a similar format. That is get rid of the '()' and instead
use a formatted 2D table output that is properly padded.

I would also propose to make this the default.

However had, in the event that people prefer the current output of "gem list" I propose to actually
not change anything, and instead add an additional commandline variant here such as:

gem list --table   # or without --
gem list --format # or without --

This should then be similar to the pip output, perhaps including "Package" and "Version" as header.

Rationale: I believe some users may prefer a padded output that is simpler to parse and read. Right
now if you have lots of gems, it is all a bit messy. I recently had to use python and pip and I found
that this is a tiny bit easier to read and keep track of when using pip.

I am appreciative of anyone having pro/con opinion about this, and as said, I am not actually really
proposing to change the default, but primarily about enabling a similar format style. People
could then alias this such as I do via "geml" being an alias to "gem list". I could change that to
"gem list --format" or whatever other commandline variant is acceptable then.

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions