()
return args
Parses, validates and returns arguments, passed to the script
Parses, validates and returns arguments, passed to the script
Parses validates and returns arguments passed to the script
def get_args():
    """Parses, validates and returns arguments, passed to the script"""
    parser = argparse.ArgumentParser()
    parser.add_argument('--repo', dest='repo', action='store')
    parser.add_argument('--after_date', dest='after_date', action='store')
    parser.add_argument('--output', dest='output', action='store')
    parser.add_argument('--token', dest='token', action='store')
    args = parser.parse_args()
    if not args.repo:
        print 'Repo is not specified'
        sys.exit(1)

    if not args.after_date:
        print 'After date is not specified'
        sys.exit(1)

    if not args.output:
        print 'Output path is not specified'
        sys.exit(1)

    if not args.token:
        print 'Github token is not specified'
        sys.exit(1)

    print 'Args are: %s' %args
    return args
def get_args ( ) : parser = argparse . ArgumentParser ( ) parser . add_argument ( '--repo' , dest = 'repo' , action = 'store' ) parser . add_argument ( '--after_date' , dest = 'after_date' , action = 'store' ) parser . add_argument ( '--output' , dest = 'output' , action = 'store' ) parser . add_argument ( '--token' , dest = 'token' , action = 'store' ) args = parser . parse_args ( ) if not args . repo : print 'Repo is not specified' sys . exit ( 1 ) if not args . after_date : print 'After date is not specified' sys . exit ( 1 ) if not args . output : print 'Output path is not specified' sys . exit ( 1 ) if not args . token : print 'Github token is not specified' sys . exit ( 1 ) print 'Args are: %s' % args return args