nixos-config/users/home-manager/foo-dogsquared/config/emacs/snippets/python-mode/app
Gabriel Arazas 3a022a374a Restructure the modules
I think this is better for separating modules explicitly. This is also
considered as there are similar objects between modules (e.g., NixOS
and home-manager modules and users).

Revert users module to old position
2021-12-06 17:03:39 +08:00

37 lines
931 B
Plaintext
Executable File

# -*- mode: snippet -*-
# name: Org-Mode appendix block
# key: app
# --
#!/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
${0:# INSERT ALL OF THE CODES RIGHT HERE}
if __name__ == "__main__":
logging.basicConfig(format="[%(levelname)s] %(module)s: %(message)s", level=logging.INFO, stream=sys.stdout)
args = parse_args(sys.argv[1:])
# Make your main logic here