Skip to content

Commit

Permalink
Merge pull request #130 from sugatoray/update_commandline_help
Browse files Browse the repository at this point in the history
Update CLI helpdoc formatting to allow indentation in code
  • Loading branch information
gagb authored Dec 19, 2024
2 parents 925c449 + a5f39d6 commit 7147bef
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 18 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
.vscode

# Byte-compiled / optimized / DLL files
__pycache__/
*.py[cod]
Expand Down
39 changes: 21 additions & 18 deletions src/markitdown/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,31 +3,34 @@
# SPDX-License-Identifier: MIT
import sys
import argparse
from textwrap import dedent
from ._markitdown import MarkItDown


def main():
parser = argparse.ArgumentParser(
description="Convert various file formats to markdown.",
formatter_class=argparse.RawDescriptionHelpFormatter,
usage="""
SYNTAX:
markitdown <OPTIONAL: FILENAME>
If FILENAME is empty, markitdown reads from stdin.
EXAMPLE:
markitdown example.pdf
OR
cat example.pdf | markitdown
OR
markitdown < example.pdf
""".strip(),
usage=dedent(
"""
SYNTAX:
markitdown <OPTIONAL: FILENAME>
If FILENAME is empty, markitdown reads from stdin.
EXAMPLE:
markitdown example.pdf
OR
cat example.pdf | markitdown
OR
markitdown < example.pdf
"""
).strip(),
)

parser.add_argument("filename", nargs="?")
Expand Down

0 comments on commit 7147bef

Please sign in to comment.