Skip to content

Commit

Permalink
Merge pull request #765 from basnijholt/patch-1
Browse files Browse the repository at this point in the history
Allow to call `conda-lock -h` (argparse default) instead of `conda-lock --help`
  • Loading branch information
maresb authored Jan 9, 2025
2 parents a032544 + b408e8d commit 306e074
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions conda_lock/conda_lock.py
Original file line number Diff line number Diff line change
Expand Up @@ -1191,8 +1191,10 @@ def main() -> None:
Literal["CRITICAL"],
]

CONTEXT_SETTINGS = {"show_default": True, "help_option_names": ["--help", "-h"]}

@main.command("lock", context_settings={"show_default": True})

@main.command("lock", context_settings=CONTEXT_SETTINGS)
@click.option(
"--conda",
default=None,
Expand Down Expand Up @@ -1457,7 +1459,7 @@ def lock(
DEFAULT_INSTALL_OPT_LOCK_FILE = pathlib.Path(DEFAULT_LOCKFILE_NAME)


@main.command("install", context_settings={"show_default": True})
@main.command("install", context_settings=CONTEXT_SETTINGS)
@click.option(
"--conda",
default=None,
Expand Down Expand Up @@ -1611,7 +1613,7 @@ def install(
install_func(file=lockfile)


@main.command("render", context_settings={"show_default": True})
@main.command("render", context_settings=CONTEXT_SETTINGS)
@click.option(
"--dev-dependencies/--no-dev-dependencies",
is_flag=True,
Expand Down Expand Up @@ -1692,7 +1694,7 @@ def render(
)


@main.command("render-lock-spec", context_settings={"show_default": True})
@main.command("render-lock-spec", context_settings=CONTEXT_SETTINGS)
@click.option(
"--conda",
default=None,
Expand Down

0 comments on commit 306e074

Please sign in to comment.