From dabbf2d2ceceff540b94e96eeb06d5c31b702964 Mon Sep 17 00:00:00 2001 From: Bas Nijholt Date: Tue, 7 Jan 2025 17:38:39 -0800 Subject: [PATCH 1/2] Allow to call `conda-lock -h` --- conda_lock/conda_lock.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/conda_lock/conda_lock.py b/conda_lock/conda_lock.py index 0d8b9ffc..2d421780 100644 --- a/conda_lock/conda_lock.py +++ b/conda_lock/conda_lock.py @@ -1192,7 +1192,7 @@ def main() -> None: ] -@main.command("lock", context_settings={"show_default": True}) +@main.command("lock", context_settings={"show_default": True, "help_option_names": ["--help", "-h"]}) @click.option( "--conda", default=None, From b408e8d3bf7c8224e9908117fdce7d74f31bba64 Mon Sep 17 00:00:00 2001 From: Bas Nijholt Date: Tue, 7 Jan 2025 17:42:36 -0800 Subject: [PATCH 2/2] Use same -h everywhere --- conda_lock/conda_lock.py | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/conda_lock/conda_lock.py b/conda_lock/conda_lock.py index 2d421780..60b1a0ae 100644 --- a/conda_lock/conda_lock.py +++ b/conda_lock/conda_lock.py @@ -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, "help_option_names": ["--help", "-h"]}) + +@main.command("lock", context_settings=CONTEXT_SETTINGS) @click.option( "--conda", default=None, @@ -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, @@ -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, @@ -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,