Skip to content

Instantly share code, notes, and snippets.

@ConstantinoSchillebeeckx
Last active October 30, 2018 22:30
Show Gist options
  • Save ConstantinoSchillebeeckx/9d6339550d2767e279a8df5cb4a3197d to your computer and use it in GitHub Desktop.
Save ConstantinoSchillebeeckx/9d6339550d2767e279a8df5cb4a3197d to your computer and use it in GitHub Desktop.
#!/usr/bin/env python3
'''
TODOC
Usage:
------
./boiler_plate.py -d required -p optional
'''
__author__ = "Constantino Schillebeeckx"
__version__ = "0.1.0"
__license__ = "N/A"
import argparse
def main(args):
# MAIN
if __name__ == "__main__":
parser = argparse.ArgumentParser(
usage=__doc__,
formatter_class=argparse.ArgumentDefaultsHelpFormatter
)
required = parser.add_argument_group('required arguments')
# Specify output of "--version"
parser.add_argument(
"--version",
action="version",
version="%(prog)s (version {version})".format(version=__version__))
required.add_argument(
"-d",
"--dir",
action="store",
required=True,
help=(
"Required argument gets its own section."
)
)
parser.add_argument(
"-p",
"--problem",
action="store",
default='problem',
help="Optional argument"
)
args = parser.parse_args()
main(args)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment