mkdocs / mkdocs-click

An MkDocs extension to generate documentation for Click command line applications
https://pypi.org/project/mkdocs-click
Apache License 2.0
105 stars 15 forks source link

Context/Options not being picked up with multi-commands #48

Open bstivers opened 2 years ago

bstivers commented 2 years ago

Following this click multi-command example:

Context is being passed around the multi-commands properly when on the command line. So I know my coding is proper.

However, help_option_names¸for example, isn't being picked up by mkdocs-click.

Current Behavior

wbscc

This tool's subcommands are loaded from a plugin folder dynamically.

Usage:

wbscc [OPTIONS] COMMAND [ARGS]...

Options:

Name Type Description Default
--help boolean Show this message and exit. False

Relevant code

CONTEXT_SETTINGS = {
    "token_normalize_func": lambda x: x.lower(),
    "help_option_names": ["-h", "--help"],
}

From command line

$ wbscc --help
Usage: wbscc [OPTIONS] COMMAND [ARGS]...

  This tool's subcommands are loaded from a plugin folder dynamically.

Options:
  -h, --help  Show this message and exit.

Commands:
  hello  Prints hello.

Expected Behavior

wbscc

This tool's subcommands are loaded from a plugin folder dynamically.

Usage:

wbscc [OPTIONS] COMMAND [ARGS]...

Options:

Name Type Description Default
-h, --help boolean Show this message and exit. False