Created
February 8, 2016 20:15
-
-
Save z1nkum/aeafb5313fbda71a6c20 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 python | |
import argparse | |
import logging | |
from sys import stdout | |
logging.basicConfig(stream=stdout, | |
level=logging.ERROR, | |
format='%(asctime)s\t%(process)d\t%(levelname)s\t%(message)s') | |
logger = logging.getLogger(__name__) | |
if __name__ == "__main__": | |
parser = argparse.ArgumentParser() | |
parser.add_argument('--backend', metavar='B', type=str, nargs=1, help='Help string 1') | |
parser.add_argument('--type', metavar='T', type=str, nargs=1, help='Help string 2') | |
parser.add_argument('--sockets', metavar='S', type=str, nargs='+', help='Help string 3') | |
parser.add_argument('--verbose', help='makes it chatty', action="store_true") | |
args = parser.parse_args() | |
if args.verbose: | |
logger.setLevel(level=logging.DEBUG) | |
logger.debug(args) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment