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

Hack week help menu #782

Merged
merged 7 commits into from
Sep 21, 2022
Merged

Hack week help menu #782

merged 7 commits into from
Sep 21, 2022

Conversation

corinnesollows
Copy link
Contributor

Checklist

=========

  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have checked for similar issues and haven't found anything relevant.
  • This is not a security issue (which should be reported here: https://circleci.com/security/)
  • I have read Contribution Guidelines.

Changes

=======

  • Beautified Cobra Command Help menu by overwriting their default help menu

Rationale

=========

Implementing changes that were made during last hack week

Considerations

==============

Helping make our CLI look more professional

Screenshots

============

Before

Screen Shot 2022-09-20 at 3 03 38 PM

After

Light Mode:

Screen Shot 2022-09-20 at 2 50 14 PM

Dark Mode:
Screen Shot 2022-09-20 at 2 50 29 PM

@corinnesollows corinnesollows requested a review from a team as a code owner September 20, 2022 18:05
Copy link
Contributor

@am-bui am-bui left a comment

Choose a reason for hiding this comment

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

Clean and pretty!

@corinnesollows corinnesollows merged commit 3b49940 into master Sep 21, 2022
@corinnesollows corinnesollows deleted the hack-week-help-menu branch September 21, 2022 18:21
threepipes pushed a commit to threepipes/circleci-cli that referenced this pull request Sep 22, 2022
* Overwrote default cobra command help menu
* Added testing env var
@mjgiarlo
Copy link

mjgiarlo commented Oct 3, 2022

Hi! @am-bui @corinnesollows Love these CLI changes.

Naïve question: how does one switch between dark and light modes?

@adam-alula
Copy link

I'm with @mjgiarlo wondering how I utilize light mode. I cannot read the help menu anymore in my terminal which uses a light theme. The border also wraps poorly if a terminal is only so wide.

@mjgiarlo
Copy link

mjgiarlo commented Oct 7, 2022

@adam-alula 💬

I'm with @mjgiarlo wondering how I utilize light mode. I cannot read the help menu anymore in my terminal which uses a light theme. The border also wraps poorly if a terminal is only so wide.

Yes, that is the same boat I'm in. In the meantime, you can prefix TESTING=true to the CLI command to get back the old menu.

@mjgiarlo
Copy link

mjgiarlo commented Oct 7, 2022

@adam-alula As best I can tell, this is handled entirely automagically via the termenv library---I can't find any switches, environment variables, or configuration to vary this as a CLI user. You can see termenv's support for various terminals here: https://github.com/muesli/termenv#optional-feature-support (As a tmux user myself, this is a bit of a bummer, but TESTING=true is good enough for me.)

@adam-alula
Copy link

@mjgiarlo setting TESTING works for now. I will create an alias and cross my fingers until I have to address this again. Thank you for the insight into the problem!

@mjgiarlo
Copy link

mjgiarlo commented Oct 7, 2022

@adam-alula While spelunking in the termenv library, I discovered the COLORFGBG environment variable which it can use to determine whether the terminal has a dark or light background. My terminal doesn't set it by default, so I figured why not try it?

So to "force" light mode:

$ COLORFGBG="0;15" circleci help

or dark mode:

$ COLORFGBG="15;0" circleci help

Works for me, anyway. Though note that these will be using ANSI colors, so it's not super colorful but the text is at least visible.

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.

4 participants