-
-
Notifications
You must be signed in to change notification settings - Fork 1k
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
"help help" doesn't use color #538
Comments
That's a bug. I used to protect against this, but I think I regressed a few versions back since I didn't add a test for it....thanks for letting me know! |
Aaaah, so digging into this, it actually wasn't a regression, but a logic bug I hadn't thought of. When the feature to allow both versions |
I have a local branch with this fixed. Once I knock out a few more issues I'll roll up the PR. Also, I forgot to address the lack of color. This wasn't a bug per-se, the Either way, the fix I have correctly dispatches |
I had used global_setting, though, and
That seems unusual; I think it made sense for |
I hadn't thought of it like that. Hmmm....let me see if I can make that work before pushing this PR since the more I think about it, the more I like how you stated it. |
Ok, I got this working in the way you said, and I'm much happier with it now. Should be able to roll up the PR in a minute. |
I have a subcommand let yaml = load_yaml!("cli.yml");
let app_m = clap::App::from_yaml(yaml)
.setting(clap::AppSettings::SubcommandRequired)
.global_setting(clap::AppSettings::ColoredHelp)
.get_matches(); the clap version is 2.9.2 |
Any feedback? |
@chenhouwu this is because the global settings need to be applied prior to the subcommand being added to the parent command. Adding a |
Still the same result following your instruction, i.e. help for main command is colored, but help for subcommand is not colored. also, I can run if I have the following line in the yml file, what's the correct way to config this? setting: "SubcommandRequired" |
Could you open a new issue for this, it'll be easier to track and fix that way. 😉 |
for the uncolored subcommand, see this issue: #591 |
OK now, with the following lines in the yml file global_settings:
- ColoredHelp |
When clap provides a
help
subcommand, runningcommand help help
produces help for thehelp
subcommand:However, this help doesn't use color, unlike the help for every other subcommand.
The text was updated successfully, but these errors were encountered: