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

Add links to repo to show/outdated commands package lists #10430

Merged
merged 2 commits into from Jan 5, 2022

Conversation

Seldaek
Copy link
Member

@Seldaek Seldaek commented Jan 4, 2022

fixes #9367

image

If someone thinks of another good use case for this, do tell.

@ThomasLandauer
Copy link
Contributor

The general problem here is that there are two "standards" on how to display links in a console:

  1. Old-fashioned: Display the URL verbatim: https://github.com/symfony/..., and then rely on the terminal's auto-detection to make it clickable. This is (as far as I know) supported by every terminal.
  2. Fancy (i.e. HTML-like): Add some special characters to allow displaying a different link text. This is supported by some terminals: https://gist.github.com/egmontkob/eb114294efbcd5adb1944c9f3cb5feda

I don't know how the adoption of (2) will progress. But for Konsole (=default in KDE) it doesn't look too good: https://bugs.kde.org/show_bug.cgi?id=379294
And (frankly) I'm also not sure if it's a good idea at all...

What I originally had in mind in #9367 was to display the link instead of the description:

symfony/polyfill-ctype   v1.23.0   https://github.com/symfony/...

Or maybe introduce some configuration to let the user decide?

@Seldaek
Copy link
Member Author

Seldaek commented Jan 4, 2022

Yes to me the critical links that need to be seen need to be of the first type as even the dumbest terminal will let you copy paste the url. Here though it's kinda nice to have functionality and I feel like this approach lets us pack more info and functionality in the same amount of text/output which is good.

Letting the user decide is always an option but it also adds complexity across the board (in code, docs, cognitive for users,..) so in this case I don't particularly feel it's justified as one can also easily get the info somewhere else if needed.

@staabm
Copy link
Contributor

staabm commented Jan 5, 2022

Looking at it, it might be usefull to have the version number link to packagist

@Seldaek
Copy link
Member Author

Seldaek commented Jan 5, 2022

@staabm that's unfortunately quite messy to do as we don't have a direct link to packagist available there.

I have now added more links in various other commands though.

@Seldaek
Copy link
Member Author

Seldaek commented Jan 5, 2022

Think I am going to merge as is, sorry @ThomasLandauer if this doesn't quite match what you had in mind, but note that you can use --format=json output to get to the URLs otherwise. Combined with jq this should kinda easily let you script this yourself.

@Seldaek Seldaek merged commit b96c419 into composer:main Jan 5, 2022
@Seldaek Seldaek deleted the add_links branch January 5, 2022 13:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Suggestion: Display package's "homepage" instead of "description" in composer show list
3 participants