Merge pull request #130 from sugatoray/update_commandline_help
Update CLI helpdoc formatting to allow indentation in code
This commit is contained in:
2
.gitignore
vendored
2
.gitignore
vendored
@@ -1,3 +1,5 @@
|
||||
.vscode
|
||||
|
||||
# Byte-compiled / optimized / DLL files
|
||||
__pycache__/
|
||||
*.py[cod]
|
||||
|
||||
@@ -3,6 +3,7 @@
|
||||
# SPDX-License-Identifier: MIT
|
||||
import sys
|
||||
import argparse
|
||||
from textwrap import dedent
|
||||
from ._markitdown import MarkItDown
|
||||
|
||||
|
||||
@@ -10,13 +11,14 @@ def main():
|
||||
parser = argparse.ArgumentParser(
|
||||
description="Convert various file formats to markdown.",
|
||||
formatter_class=argparse.RawDescriptionHelpFormatter,
|
||||
usage="""
|
||||
SYNTAX:
|
||||
usage=dedent(
|
||||
"""
|
||||
SYNTAX:
|
||||
|
||||
markitdown <OPTIONAL: FILENAME>
|
||||
If FILENAME is empty, markitdown reads from stdin.
|
||||
|
||||
EXAMPLE:
|
||||
EXAMPLE:
|
||||
|
||||
markitdown example.pdf
|
||||
|
||||
@@ -27,7 +29,8 @@ EXAMPLE:
|
||||
OR
|
||||
|
||||
markitdown < example.pdf
|
||||
""".strip(),
|
||||
"""
|
||||
).strip(),
|
||||
)
|
||||
|
||||
parser.add_argument("filename", nargs="?")
|
||||
|
||||
Reference in New Issue
Block a user