click-contrib / sphinx-click

A Sphinx plugin to automatically document click-based applications
MIT License
212 stars 57 forks source link

Support count=True option references #69

Closed SeanDS closed 3 years ago

SeanDS commented 3 years ago

Currently click options specified with count=True, useful for verbose flags for example, are not supported in N-length form:

Specify :option:`-vv` to enable debug output.

The above issues the following warning while building with Sphinx:

WARNING: unknown option: -vv
stephenfin commented 3 years ago

I'm afraid this is not something that's within our control. Sphinx provides the :option: role and we merely reuse it. I suspect you'll have to do without cross-referencing here or work around it with something like:

Specify ``-vv`` (:option:`-v`) to enable debug output.
SeanDS commented 3 years ago

Would this work if sphinx-click output additional options in the .. option role?

.. option:: -v, -vv, -vvv

    Enable verbosity.

Perhaps the number of options (i.e. 3 for -vvv) could be controlled by an option in the .. click:: role?