Skip to content

Instantly share code, notes, and snippets.

@taoliu
Created April 29, 2020 21:56
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save taoliu/fbcbe57df7cd1f06f9c80f23cbd562b8 to your computer and use it in GitHub Desktop.
Save taoliu/fbcbe57df7cd1f06f9c80f23cbd562b8 to your computer and use it in GitHub Desktop.
#!/usr/bin/env python3
# Time-stamp: <2008-04-07 17:51:27 Tao Liu>
"""Module Description
Copyright (c) 2020 Tao Liu <vladimir.liu@gmail.com>
This code is free software; you can redistribute it and/or modify it
under the terms of the BSD License (see the file COPYING included with
the distribution).
@status: experimental
@version: $Revision$
@author: Tao Liu
@contact: taoliu@jimmy.harvard.edu
"""
# ------------------------------------
# python modules
# ------------------------------------
import os
import sys
import argparse as ap
# ------------------------------------
# constants
# ------------------------------------
# ------------------------------------
# Misc functions
# ------------------------------------
# ------------------------------------
# Classes
# ------------------------------------
# ------------------------------------
# Main function
# ------------------------------------
def prepare_argparser ():
description = "%(prog)s -- blah blah blah"
epilog = "For command line options of each command, type: %(prog)s COMMAND -h"
argparser = ap.ArgumentParser( description = description, epilog = epilog )
argparser.add_argument("--version", action = "version", version="%(prog)s 0.1")
argparser.add_argument("-i", "--ifile", dest = "ifile", type = str, required = True, help="input file")
argparser.add_argument("-o", "--ofile", dest = "ofile", help = "output file")
return argparser
def main():
# Parse options...
argparser = prepare_argparser()
args = argparser.parse_args()
return
if __name__ == '__main__':
try:
main()
except KeyboardInterrupt:
sys.stderr.write("User interrupt me! ;-) See you!\n")
sys.exit(0)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment