Skip to content
This repository has been archived by the owner on Jul 4, 2023. It is now read-only.

Add installed status indicator for deps command #19033

Closed

Conversation

colindean
Copy link
Member

  • display a green checkmark or red x indicating installed?
  • simply highlight dep in green or red to show status if HOMEBREW_NO_EMOJI is set

See also #18922. This came out of that discussion.

An opportunity for improvement of this and the eventual result of #18922 is refactoring to have both commands use the same dependency decoration code. If both are accepted, I'll undertake this once I gain an understanding of where this code would live, with the necessity that a user be able to monkeypatch it with their own decorator.

@colindean
Copy link
Member Author

Any more thoughts on this?

@MikeMcQuaid
Copy link
Member

I'll have a look.

@MikeMcQuaid
Copy link
Member

This works for me but I'll wait for a +1 from another maintainer.

@jacknagel
Copy link
Contributor

Does this check $stdout.tty??

@colindean
Copy link
Member Author

@jacknagel: it does not. Shall I add this check in? What should be the expected behavior? If $stdout.tty? is false, do not use colors?

@jacknagel
Copy link
Contributor

brew deps is meant to be pipeable, so if $stdout.tty? is false, the output should be exactly as it is now.

@colindean
Copy link
Member Author

Good point. Fixed.

Screen Shot 2013-04-27 at 1 46 36 PM

@colindean
Copy link
Member Author

Changed xout to cross_out per @MikeMcQuaid's suggestion.

@adamv
Copy link
Contributor

adamv commented Jul 30, 2013

Probably needs to be rebased on master.

@colindean
Copy link
Member Author

I took a look, and it's going to need considerable work to rebase. I'll take a shot if I get some time this weekend.

@colindean
Copy link
Member Author

Looking at this now, and the dep calculation got significantly more complex over time. I might try and entirely different approach...

* display a green checkmark or red x indicating installed?
* simply highlight dep to show status if `HOMEBREW_NO_EMOJI` is set
* do nothing if stdout is not a tty
@colindean
Copy link
Member Author

THIS COMMIT IS SEMI-BROKEN AND NOT YET READY.

I've made significant progress, but I'm stuck on formulae where a dependency is noted as a symbol instead of a string. Examples: zpython, zabbix.

I've run out of time available this evening.

What I think I want to do is to ensure that everything going into the decoration methods is of class Dependency, which it appears to be, except when a dependency is noted as a symbol. I guess I need to figure a way to get a Dependency given a symbol.

@MikeMcQuaid
Copy link
Member

@colindean I think that symbol dependency stuff has been changed.

@colindean
Copy link
Member Author

I'll take a look if I get a chance this weekend.

@adamv
Copy link
Contributor

adamv commented May 4, 2014

This needs to be rebased on master for further review, but note that @jacknagel is refactoring this part of the code so further breakage is expected.

@adamv
Copy link
Contributor

adamv commented Sep 25, 2014

Passing on this for now.

@adamv adamv closed this Sep 25, 2014
@Homebrew Homebrew locked and limited conversation to collaborators Feb 16, 2016
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants