Skip to content

Commit

Permalink
Use raw formatter
Browse files Browse the repository at this point in the history
  • Loading branch information
sultaniman committed Mar 25, 2024
1 parent 075defb commit bee5c49
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 12 deletions.
6 changes: 5 additions & 1 deletion dlt/cli/_dlt.py
Original file line number Diff line number Diff line change
Expand Up @@ -603,7 +603,11 @@ def main() -> int:
subparsers.add_parser("telemetry", help="Shows telemetry status")

# CLI pipeline runner
run_cmd = subparsers.add_parser("run", help="Run pipelines in a given directory")
run_cmd = subparsers.add_parser(
"run",
help="Run pipelines in a given directory",
formatter_class=argparse.RawTextHelpFormatter,
)

run_cmd.add_argument(
"module",
Expand Down
25 changes: 14 additions & 11 deletions dlt/common/cli/runner/help.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
from typing_extensions import get_args
from dlt.cli import echo as fmt
from dlt.common.destination.capabilities import TLoaderFileFormat
from dlt.common.schema.typing import TSchemaEvolutionMode, TWriteDisposition

Expand All @@ -7,15 +8,17 @@
supported_evolution_modes = "|".join(get_args(TSchemaEvolutionMode))
supported_write_disposition = "|".join(get_args(TWriteDisposition))

run_args_help = (
"Arguments passed to pipeline.run, allowed options "
"destination=string,\n"
"staging=string,\n"
"credentials=string,\n"
"table_name=string,\n"
f"write_disposition={supported_write_disposition},\n"
"dataset_name=string,\n"
"primary_key=string,\n"
f"schema_contract={supported_evolution_modes},\n"
f"loader_file_format={supported_formats},\n"
run_args_help = "".join(
(
"Supported arguments passed to pipeline.run are",
fmt.info_style("\n - destination=string"),
fmt.info_style("\n - staging=string,"),
fmt.info_style("\n - credentials=string,"),
fmt.info_style("\n - table_name=string,"),
fmt.info_style(f"\n - write_disposition={supported_write_disposition},"),
fmt.info_style("\n - dataset_name=string,"),
fmt.info_style("\n - primary_key=string,"),
fmt.info_style(f"\n - schema_contract={supported_evolution_modes},"),
fmt.info_style(f"\n - loader_file_format={supported_formats}"),
)
)

0 comments on commit bee5c49

Please sign in to comment.