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 colored help #30

Merged
merged 4 commits into from
Sep 25, 2019
Merged

Add colored help #30

merged 4 commits into from
Sep 25, 2019

Conversation

DrSensor
Copy link
Contributor

Types of changes

Just want to make it eye catchy 😋
Peek 2019-09-11 10-44

  • Bug fix
  • New feature
  • Breaking change

@jacobdeichert
Copy link
Owner

jacobdeichert commented Sep 15, 2019

Hey @DrSensor, thanks for the PR! I completely missed this... didn't get an email/notification from github.

I actually have been running with ColoredHelp for a few weeks locally... just to test it out and I like it 👍

edit: not sure why github CI tests didn't pass 🤔

Cargo.toml Outdated Show resolved Hide resolved
src/main.rs Outdated Show resolved Hide resolved
src/main.rs Outdated
AppSettings::ColoredHelp
} else {
AppSettings::ColorNever // in case it run on terminal without color support
});
Copy link
Owner

Choose a reason for hiding this comment

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

In my testing a few weeks ago, i thought the ColoredHelp setting was inherited from the root cli_app? We actually need to do this here too?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Unfortunately yes. Seems like most of AppSettings::* in clap doesn't propagate to Subcommands (or in another word, it doesn't applied to nested App). Probably it propagate to Subcommands only if the setting prefixed with *Subcommands (e.g VersionlessSubcommands) 🤔

example if ColoredHelp only applied to root cli_app

Screenshot_20190918_021758

@DrSensor
Copy link
Contributor Author

DrSensor commented Sep 17, 2019

edit: not sure why github CI tests didn't pass thinking

@jakedeichert, when I view it in desktop browser, it got stalled till now 🤔
Screenshot_20190918_022117

Cargo.toml Outdated
colored = "1.8.0" # https://github.com/mackwic/colored
pulldown-cmark = { version = "0.5", default-features = false } # https://github.com/raphlinus/pulldown-cmark

[dependencies.clap] # https://github.com/clap-rs/clap
version = "2.33.0"
features = ["wrap_help", "color"]
Copy link
Owner

Choose a reason for hiding this comment

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

Can we remove "color" here? It's a default feature so we don't need to specify it :)

Suggested change
features = ["wrap_help", "color"]
features = ["wrap_help"]

Copy link
Contributor Author

Choose a reason for hiding this comment

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

done 702afad 😋

@jacobdeichert
Copy link
Owner

Hey! I left 1 more comment. I tried the PR locally and i'm happy with it... wrap_help is nice too.

After you fix the 1 line, i'll merge and release to cargo 👍

Co-Authored-By: Jake Deichert <[email protected]>
@jacobdeichert jacobdeichert merged commit 891eb68 into jacobdeichert:master Sep 25, 2019
@jacobdeichert
Copy link
Owner

@DrSensor just published v0.5.1 !

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.

2 participants