2020-11-12 15:44:48 +00:00
# -*- mode: snippet -*-
# name: Org-Mode appendix block
2020-12-12 03:05:06 +00:00
# key: app
2020-11-12 15:44:48 +00:00
# --
#!/usr/bin/env python
import argparse
import logging
import os
import os.path
from pathlib import Path
import sys
def parse_args(args):
"""
Parse the arguments and do its thing.
"""
parser = argparse.ArgumentParser(prog='${1:<APPNAME>}', description='${2:<DESCRIPTION>}')
parser.add_argument("csv_file", help='The CSV file to be imported.', metavar='FILE')
parser.add_argument("--force", "-f", help="Override the password entry if it already exists. (Recommended to enable this only if you're sure.)", action="store_true")
args = parser.parse_args(args)
return args
2020-12-12 03:05:06 +00:00
${0:# INSERT ALL OF THE CODES RIGHT HERE}
2020-11-12 15:44:48 +00:00
if __name__ == "__main__":
logging.basicConfig(format="[%(levelname)s] %(module)s: %(message)s", level=logging.INFO, stream=sys.stdout)
args = parse_args(sys.argv[1:])
2020-12-12 03:05:06 +00:00
# Make your main logic here