Skip to content

Commit

Permalink
add CLI completion
Browse files Browse the repository at this point in the history
  • Loading branch information
casperdcl committed Dec 20, 2024
1 parent 6ea36f9 commit 1ba0a8e
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
1 change: 1 addition & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ dependencies = [
"pdfminer.six",
"puremagic",
"pydub",
"shtab",
"youtube-transcript-api",
"SpeechRecognition",
"pathvalidate",
Expand Down
4 changes: 3 additions & 1 deletion src/markitdown/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
import sys
import argparse
from textwrap import dedent
import shtab
from ._markitdown import MarkItDown


Expand All @@ -22,7 +23,8 @@ def main():

parser.add_argument(
"filename", nargs="?", help="if unspecified, defaults to stdin"
)
).complete = shtab.FILE
shtab.add_argument_to(parser)
args = parser.parse_args()
markitdown = MarkItDown()
result = markitdown.convert(args.filename or sys.stdin.buffer)
Expand Down

0 comments on commit 1ba0a8e

Please sign in to comment.