Created
April 29, 2020 21:56
-
-
Save taoliu/fbcbe57df7cd1f06f9c80f23cbd562b8 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python3 | |
# Time-stamp: <2008-04-07 17:51:27 Tao Liu> | |
"""Module Description | |
Copyright (c) 2020 Tao Liu <[email protected]> | |
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: [email protected] | |
""" | |
# ------------------------------------ | |
# 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