Update CLI helpdoc formatting to allow indentation in code

Use `textwrap.dedent()` to allow indented cli-helpdoc in `__main__.py` file. The indentation increases readability, while `textwrap.dedent` helps maintain the same functionality without breaking code.
This commit is contained in:
Sugato Ray 2024-12-18 14:22:58 -05:00 committed by GitHub
parent 1deaba1c6c
commit 39410d01df
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -3,6 +3,7 @@
# SPDX-License-Identifier: MIT
import sys
import argparse
from textwrap import dedent
from ._markitdown import MarkItDown
@ -10,7 +11,7 @@ def main():
parser = argparse.ArgumentParser(
description="Convert various file formats to markdown.",
formatter_class=argparse.RawDescriptionHelpFormatter,
usage="""
usage=dedent("""
SYNTAX:
markitdown <OPTIONAL: FILENAME>
@ -27,7 +28,7 @@ EXAMPLE:
OR
markitdown < example.pdf
""".strip(),
""").strip(),
)
parser.add_argument("filename", nargs="?")