mjestecko/tools/plaintext_article_listing_generator.py

16 lines
306 B
Python
Raw Permalink Normal View History

2024-02-24 06:33:57 +00:00
#!/usr/bin/env python3
from sys import argv, exit
from article_utils import parse_article_directory, sort_titles_by_date
if len(argv) <= 1:
print("No directory was supplied")
exit(-1)
articles = parse_article_directory(argv[1])
result = '\n'.join(sort_titles_by_date(articles))
print(result)