From 2a4f7bb6a8e3a5a4bd73e0dcfe1849205f62708a Mon Sep 17 00:00:00 2001 From: Werner Robitza Date: Sun, 9 Feb 2025 05:50:38 +0100 Subject: [PATCH] fix: argparse CLI option ordering, fixes #268 (#290) * fix: argparse CLI option ordering, fixes #268 * Fixed formatting. --- src/markitdown/__main__.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/markitdown/__main__.py b/src/markitdown/__main__.py index 69e8f0e..353be84 100644 --- a/src/markitdown/__main__.py +++ b/src/markitdown/__main__.py @@ -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(): @@ -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: