CLI

The markdown-checker command-line entry point. See Command-Line Options for a user-facing option reference.

Click-based command-line entry point (the markdown-checker command).

class markdown_checker.cli.PyprojectCommand(name, context_settings=None, callback=None, params=None, help=None, epilog=None, short_help=None, options_metavar='[OPTIONS]', add_help_option=True, no_args_is_help=False, hidden=False, deprecated=False)

Bases: Command

Command that seeds ctx.default_map from [tool.markdown-checker] in pyproject.toml.

Parameters:
make_context(info_name, args, parent=None, **extra)

This function when given an info name and arguments will kick off the parsing and create a new Context. It does not invoke the actual command callback though.

To quickly customize the context class used without overriding this method, set the context_class attribute.

Parameters:
  • info_name (str | None) – the info name for this invocation. Generally this is the most descriptive name for the script or command. For the toplevel script it’s usually the name of the script, for commands below it’s the name of the command.

  • args (list[str]) – the arguments to parse as list of strings.

  • parent (Context | None) – the parent context if available.

  • extra (Any) – extra keyword arguments forwarded to the context constructor.

Return type:

Context

Changed in version 8.0: Added the context_class attribute.

class markdown_checker.cli.ListOfStrings(param_decls=None, show_default=None, prompt=False, confirmation_prompt=False, prompt_required=True, hide_input=False, is_flag=None, flag_value=UNSET, multiple=False, count=False, allow_from_autoenv=True, type=None, help=None, hidden=False, show_choices=True, show_envvar=False, deprecated=False, **attrs)

Bases: Option

Helper class to parse a comma-separated list of strings from the command line.

Ref: https://stackoverflow.com/questions/47631914/how-to-pass-several-list-of-arguments-to-click-option

Parameters:
  • param_decls (cabc.Sequence[str] | None)

  • show_default (bool | str | None)

  • prompt (bool | str)

  • confirmation_prompt (bool | str)

  • prompt_required (bool)

  • hide_input (bool)

  • is_flag (bool | None)

  • flag_value (t.Any)

  • multiple (bool)

  • count (bool)

  • allow_from_autoenv (bool)

  • type (types.ParamType[t.Any] | t.Any | None)

  • help (str | None)

  • hidden (bool)

  • show_choices (bool)

  • show_envvar (bool)

  • deprecated (bool | str)

  • attrs (t.Any)

type_cast_value(ctx, value)

Convert and validate a value against the parameter’s type, multiple, and nargs.

Return type:

list[str]