add command line interface
This commit is contained in:
23
command_line.py
Normal file
23
command_line.py
Normal file
@@ -0,0 +1,23 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
import argparse
|
||||
|
||||
# from md_tagebuch import __version__
|
||||
import converter
|
||||
|
||||
def get_parser():
|
||||
parser = argparse.ArgumentParser(description='Generate marp markdown slides from csv')
|
||||
# required arg
|
||||
parser.add_argument("inputFile", help="name of the csv file to used as input, e.g. quiz.csv",
|
||||
type=str)
|
||||
return parser
|
||||
|
||||
|
||||
def command_line_runner():
|
||||
parser = get_parser()
|
||||
args = parser.parse_args()
|
||||
converter.write_markdown_file(args.inputFile)
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
command_line_runner()
|
||||
Reference in New Issue
Block a user