Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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?

like image 570
Ram Rachum Avatar asked Dec 17 '15 12:12

Ram Rachum


2 Answers

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.

like image 63
halloleo Avatar answered Sep 18 '22 14:09

halloleo


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

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

like image 29
Merlijn Sebrechts Avatar answered Sep 22 '22 14:09

Merlijn Sebrechts