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

show if the port is installed in the info and the search command #241

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

ra1nb0w
Copy link
Contributor

@ra1nb0w ra1nb0w commented May 22, 2021

This is a small enhancement that I found useful: it adds an [installed] tag in the info and search command.
In the info the tag is shown only with the heading print.
In the search the tag is shown only in multiline print.

Can be also useful to implement it in the other modes? Maybe, they are used only in scripting and therefore you can call port installed
Can be also useful to take in account the active status?

@raimue
Copy link
Member

raimue commented May 22, 2021

Hm, I think this could be slightly misleading because the version shown must not be the version that is installed.

@ra1nb0w
Copy link
Contributor Author

ra1nb0w commented May 23, 2021

Yes @raimue. I thought about that but [installed] should be only an indication that the port is installed without referring to which version but you are right, can be slightly mislead. Use [upgradable] if a new version is available? What do you think?

@ryandesign
Copy link
Contributor

I mean we could go crazy and show a label for every pseudoport that this port belongs to. [installed] [outdated] [active] [leaf] [obsolete] [requested]

@ra1nb0w
Copy link
Contributor Author

ra1nb0w commented May 24, 2021

@ryandesign sarcastic?
Since I mainly use search and info my starting idea was to show there if a package is installed or not without calling installed (just like apt*). Nothing too complicated (also to avoid slowdown).

@raimue
Copy link
Member

raimue commented May 24, 2021

Just some brainstorming on this idea. I would suggest not to put even more stuff into the first line. How about adding another line for this information instead?

$ port info dummy
dummy @1.2 (security, net)
State: installed, active, requested, outdated (@1.1_3)
Variants: universal
...

But not sure whether State: uninstalled makes sense? Probably better to leave it out in this case?

In port search it could be shown in an abbreviated form to keep the format concise. Unfortunately, "outdated" and "obsolete" cause a collision on the first letter... But as of now, port search would not show obsolete ports anyway, so it should be clear enough.

$ port search dummy
dummy @1.2 (games) [iaro]
    Just a dummy port

@mascguy
Copy link
Member

mascguy commented May 24, 2021

I'm definitely supportive of the general idea!

@ra1nb0w
Copy link
Contributor Author

ra1nb0w commented May 25, 2021

For info can be a good idea to move to a new line with full State (maintain the same UI) except uninstalled. In this case hide the line.
For search: I don't like abbreviations since you need to know it and since the command is used by anyone it should be auto-explanatory. Just one point: is not too much cpu intensive checks the full state in the search since it can be quite big?

@eugenesvk
Copy link

Could you maybe use symbols similar to what Homebrew does (though only for dependencies)?

  • green ✔ or ✓ for installed
  • red ✘ or ✗ for

They're much easier to notice that just the words

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

5 participants