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?
Python click: Make some options hidden
Asked Answered
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
.
Documentation link: click.palletsprojects.com/en/7.x/api/… –
Naevus
NB. This also works in Typer, which is based on Click. –
Zaccaria
This feature is on the verge of being included in click, you can follow the development here:
The pull request still isn't available as of 2016-11-11, but according to comments should be in the 7.x version when that comes out. –
Berard
© 2022 - 2024 — McMap. All rights reserved.
@click.command(..., hidden=true)
– Kaye