This repository has been archived on 2025-01-08. You can view files and clone it, but cannot push or open issues or pull requests.
blog-software/__main__.py

30 lines
682 B
Python
Raw Normal View History

2024-05-19 10:26:52 +02:00
from argparse import ArgumentParser
from dataclasses import dataclass
from compiler import compile
@dataclass
class Arguments:
workdir: str
2024-05-21 17:43:53 +02:00
template: str
out: str
force: str
2024-05-19 10:26:52 +02:00
def __init__(self):
pass
def main():
parser = ArgumentParser()
parser.add_argument('workdir', action='store')
2024-05-21 17:43:53 +02:00
parser.add_argument('-t' , '--template', action='store')
parser.add_argument('-o', '--out', action='store')
parser.add_argument('-f', '--force', action='store_true', default=False)
2024-05-19 10:26:52 +02:00
args = Arguments()
parser.parse_args(namespace=args)
2024-05-21 17:43:53 +02:00
compile(args.workdir, args.template, args.out, args.force)
2024-05-19 10:26:52 +02:00
if __name__ == "__main__":
main()