url2markdown/url2markdown/cli.py

16 lines
551 B
Python
Raw Normal View History

2020-10-12 22:25:36 +02:00
import argparse
def cli():
parser = argparse.ArgumentParser()
group = parser.add_mutually_exclusive_group(required=True)
group.add_argument('--file',
type=argparse.FileType('r'),
help="A file containing one URL per line.")
group.add_argument('--url',
help="The URL of the article to convert to Markdown.",
type=str)
2020-10-13 22:15:35 +02:00
parser.add_argument("--topics", help="A list of comma separated topics e.g. 'foo,bar'.")
2020-10-12 22:25:36 +02:00
return parser.parse_args()