#!python
# ------------------------------------------------
# Author:    krishna
# USAGE:
#       txtoflow sample1.c
# ------------------------------------------------
from txtoflow import txtoflow
import fileinput
import argparse


def getOpts():
    '''Process the options'''

    parser = argparse.ArgumentParser(
        description='''Generates flowchart from pseudocode'''
    )

    parser.add_argument(
        '-s', '--src',
        type=argparse.FileType('r'),
        required=True,
        help="Source file with pseudocode to convert"
    )

    # return validateOpts(parser.parse_args())
    return parser.parse_args()


def main():
    '''The Main'''

    opts = getOpts()
    txtoflow.generate(opts.src.read())


if __name__ == '__main__':
    main()