simplelogincmd.cli.lazy_group.cmd_path

cmd_path(file: str, *args: str) str

Util to construct a path to a LazyGroup’s subcommands

The final path is the parent directory of file joined with all the subdirectories in args. An example of common usage follows:

@click.group(
    "group_name",
    cls=LazyGroup,
    cmd_path=cmd_path(__file__, "subdir"),
)
def cli():
    pass

If __file__ above points to “/foo/bar.py”, then the path at which the group’s subcommands live is defined as “/foo/subdir/”.

Parameters:
  • file (str) – The path to a file, usually the one in which the group is located

  • args – One or more subdirectories relative to that containing file in which the group’s subcommands are located

Returns:

The directory in which a LazyGroup’s subcommands are located

Return type:

str