Skip to content

Commit

Permalink
small update for auto docs generation
Browse files Browse the repository at this point in the history
  • Loading branch information
sh-rp committed Jan 23, 2025
1 parent 115670e commit 50ffff5
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 5 deletions.
11 changes: 8 additions & 3 deletions dlt/cli/_dlt.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from typing import Any, Sequence, Type, cast, List, Dict
from typing import Any, Sequence, Type, cast, List, Dict, Tuple
import argparse
import click
import rich_argparse
Expand Down Expand Up @@ -100,7 +100,7 @@ def __call__(
debug.enable_debug()


def main() -> int:
def _create_parser() -> Tuple[argparse.ArgumentParser, Dict[str, SupportsCliCommand]]:
parser = argparse.ArgumentParser(
description="Creates, adds, inspects and deploys dlt pipelines.",
)
Expand Down Expand Up @@ -128,7 +128,7 @@ def main() -> int:
parser.add_argument(
"--debug", action=DebugAction, help="Displays full stack traces on exceptions."
)
subparsers = parser.add_subparsers(dest="command")
subparsers = parser.add_subparsers(title="Toplevel Commands", dest="command")

# load plugins
from dlt.common.configuration import plugins
Expand Down Expand Up @@ -156,6 +156,11 @@ def add_formatter_class(parser: argparse.ArgumentParser) -> None:

add_formatter_class(parser)

return parser, installed_commands


def main() -> int:
parser, installed_commands = _create_parser()
args = parser.parse_args()

if Venv.is_virtual_env() and not Venv.is_venv_activated():
Expand Down
4 changes: 2 additions & 2 deletions dlt/cli/plugins.py
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ def configure_parser(self, pipe_cmd: argparse.ArgumentParser) -> None:
dest="verbosity",
)

pipeline_subparsers = pipe_cmd.add_subparsers(dest="operation", required=False)
pipeline_subparsers = pipe_cmd.add_subparsers(title="Pipline operations",dest="operation", required=False)

pipe_cmd_sync_parent = argparse.ArgumentParser(add_help=False)
pipe_cmd_sync_parent.add_argument(
Expand Down Expand Up @@ -329,7 +329,7 @@ def configure_parser(self, parser: argparse.ArgumentParser) -> None:
help="Advanced. Uses specific branch of the deploy repository to fetch the template.",
)

deploy_sub_parsers = deploy_cmd.add_subparsers(dest="deployment_method")
deploy_sub_parsers = deploy_cmd.add_subparsers(title="Deployment operations", dest="deployment_method")

# deploy github actions
deploy_github_cmd = deploy_sub_parsers.add_parser(
Expand Down

0 comments on commit 50ffff5

Please sign in to comment.