mjestecko/tools/plaintext_article_listing_generator.py
2024-02-24 11:33:57 +05:00

16 lines
306 B
Python
Executable File

#!/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)