Skip to content

Commit 2a4f7bb

Browse files
authored
fix: argparse CLI option ordering, fixes #268 (#290)
* fix: argparse CLI option ordering, fixes #268 * Fixed formatting.
1 parent 7cf5e0b commit 2a4f7bb

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

src/markitdown/__main__.py

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@
44
import argparse
55
import sys
66
from textwrap import dedent
7-
from __about__ import __version__
8-
from _markitdown import MarkItDown, DocumentConverterResult
7+
from .__about__ import __version__
8+
from ._markitdown import MarkItDown, DocumentConverterResult
99

1010

1111
def main():
@@ -51,24 +51,27 @@ def main():
5151
help="show the version number and exit",
5252
)
5353

54-
parser.add_argument("filename", nargs="?")
5554
parser.add_argument(
5655
"-o",
5756
"--output",
5857
help="Output file name. If not provided, output is written to stdout.",
5958
)
59+
6060
parser.add_argument(
6161
"-d",
6262
"--use-docintel",
6363
action="store_true",
6464
help="Use Document Intelligence to extract text instead of offline conversion. Requires a valid Document Intelligence Endpoint.",
6565
)
66+
6667
parser.add_argument(
6768
"-e",
6869
"--endpoint",
6970
type=str,
7071
help="Document Intelligence Endpoint. Required if using Document Intelligence.",
7172
)
73+
74+
parser.add_argument("filename", nargs="?")
7275
args = parser.parse_args()
7376

7477
if args.use_docintel:

0 commit comments

Comments
 (0)