Ram Rachum
Ram Rachum

Reputation: 88578

Python click: Make some options hidden

I'm using click to build a CLI in Python. I have several options to the command I'm defining, and I want some of them to be hidden in --help. How can I do that?

Upvotes: 19

Views: 8845

Answers (2)

halloleo
halloleo

Reputation: 10384

Yes, you can. Use

@click.option(..., hidden=True)

The feature is now (March 2019) in the stable release of Click.

Please note: In the first implementation the functionality was realised with a parameter show=False, but is now done with hidden=True.

Upvotes: 18

Merlijn Sebrechts
Merlijn Sebrechts

Reputation: 633

This feature is on the verge of being included in click, you can follow the development here:

https://github.com/mitsuhiko/click/pull/500

Upvotes: 3

Related Questions