From 4dd1d1e611082aa32258bc023ab32111c9cde2d4 Mon Sep 17 00:00:00 2001 From: George Sittas Date: Tue, 7 Feb 2023 18:44:33 -0800 Subject: [PATCH] Fix CLI: enable --help without requiring context instantiation --- sqlmesh/cli/main.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/sqlmesh/cli/main.py b/sqlmesh/cli/main.py index 7816a82a19..cdc7202b11 100644 --- a/sqlmesh/cli/main.py +++ b/sqlmesh/cli/main.py @@ -1,6 +1,7 @@ from __future__ import annotations import os +import sys import typing as t import click @@ -44,6 +45,10 @@ def cli( ctx.obj = path return + # Delegates the execution of the --help option to the corresponding subcommand + if "--help" in sys.argv: + return + context = Context( path=path, config=config,