Skip to content
This repository has been archived by the owner on Jan 1, 2022. It is now read-only.

No way to create a global template #87

Open
epage opened this issue Dec 6, 2021 · 2 comments
Open

No way to create a global template #87

epage opened this issue Dec 6, 2021 · 2 comments

Comments

@epage
Copy link
Owner

epage commented Dec 6, 2021

Issue by ascclemens
Wednesday Feb 14, 2018 at 17:46 GMT
Originally opened as clap-rs/clap#1184


Affected Version of clap

2.29.4

Expected Behavior Summary

Being able to call global_template and have the template propagate down to subcommands.

Actual Behavior Summary

For every single subcommand, I have to add a template call to get them all to match my custom template.

@epage
Copy link
Owner Author

epage commented Dec 6, 2021

Comment by kbknapp
Wednesday Feb 14, 2018 at 18:58 GMT


Totally agree this is a lacking feature, thanks for the suggestion!

In order for me to actually get v3 released I have to put blinders on and only implement bug fixes or super trivial features which are simple to forward port to the v3 branch.

I don't know that this is one such issue. I'll leave it open for v3 as it is something I do want to have.

Having said all this, if someone implements this for v2 I'm not against the PR, so long as the understanding is that for v3 I may have to rip out the commit and re-do it depending how deep into the internals it gets to implement this. (for v3 the internals are quite different, so some changes aren't trivial to forward port).

@epage
Copy link
Owner Author

epage commented Dec 6, 2021

Comment by pksunkara
Friday Oct 09, 2020 at 17:33 GMT


To solve this, we would either need to add a global_help_template function that would forward the template to children (example) or we could add a setting called PropagateTemplate which does the same.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

1 participant