Skip to content

Added handling hidden parameter in commands. #9

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

Merged
merged 2 commits into from
Mar 3, 2023

Conversation

Gargy007
Copy link
Contributor

@Gargy007 Gargy007 commented Feb 28, 2023

Issue: #8

Just check that code if it's OK for you. Thank you

Copy link
Owner

@whwright whwright left a comment

Choose a reason for hiding this comment

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

Thanks for the contribution!

@@ -30,7 +30,8 @@ def _build_command_tree(click_command):

if isinstance(click_command, click.core.Group):
for _, cmd in click_command.commands.items():
wrapper.children.append(_build_command_tree(cmd))
if not cmd.hidden:
Copy link
Owner

Choose a reason for hiding this comment

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

It looks like the hidden attribute was added in v7, and I would like to keep this library as backwards compatible as possible. Could this also handle the case where this attribute is not there?

Suggested change
if not cmd.hidden:
if not getattr(cmd, "hidden", False):

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Sure,
the offered solution was just proof of concept. Thank you for reply

@Gargy007
Copy link
Contributor Author

Gargy007 commented Mar 2, 2023

Hi,
the last one question :-) Do you have any plan / schedule to update the click-tree with this hidden commands and get it on pypi.org ?
Thanks :-)

@whwright
Copy link
Owner

whwright commented Mar 2, 2023

Hi, the last one question :-) Do you have any plan / schedule to update the click-tree with this hidden commands and get it on pypi.org ? Thanks :-)

I will make some time this weekend to get this release out

@Gargy007
Copy link
Contributor Author

Gargy007 commented Mar 2, 2023 via email

@whwright whwright merged commit d13d332 into whwright:master Mar 3, 2023
@whwright
Copy link
Owner

whwright commented Mar 3, 2023

@Gargy007 I released version 1.1.1

@Gargy007
Copy link
Contributor Author

Gargy007 commented Mar 3, 2023 via email

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