Skip to content

Commit

Permalink
fix: argparse CLI option ordering, fixes #268 (#290)
Browse files Browse the repository at this point in the history
* fix: argparse CLI option ordering, fixes #268
* Fixed formatting.
  • Loading branch information
slhck authored Feb 9, 2025
1 parent 7cf5e0b commit 2a4f7bb
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions src/markitdown/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
import argparse
import sys
from textwrap import dedent
from __about__ import __version__
from _markitdown import MarkItDown, DocumentConverterResult
from .__about__ import __version__
from ._markitdown import MarkItDown, DocumentConverterResult


def main():
Expand Down Expand Up @@ -51,24 +51,27 @@ def main():
help="show the version number and exit",
)

parser.add_argument("filename", nargs="?")
parser.add_argument(
"-o",
"--output",
help="Output file name. If not provided, output is written to stdout.",
)

parser.add_argument(
"-d",
"--use-docintel",
action="store_true",
help="Use Document Intelligence to extract text instead of offline conversion. Requires a valid Document Intelligence Endpoint.",
)

parser.add_argument(
"-e",
"--endpoint",
type=str,
help="Document Intelligence Endpoint. Required if using Document Intelligence.",
)

parser.add_argument("filename", nargs="?")
args = parser.parse_args()

if args.use_docintel:
Expand Down

0 comments on commit 2a4f7bb

Please sign in to comment.