#!/usr/bin/env python3
# -*- coding: utf-8 -*-
#
import argparse
from matplotlib import pyplot as pp
from importlib import import_module

import testfunctions


def _main():
    # get command line arguments
    test_name = _parse_options()

    # import the test
    test = import_module('testfunctions.' + test_name)

    test.plot()
    pp.show()
    return


def _parse_options():
    '''Parse input options.
    '''
    parser = argparse.ArgumentParser(
            description='Show matplotlib2tikz test plots.'
            )
    parser.add_argument(
            'test_name',
            metavar='TEST_NAME',
            type=str,
            help='test plot to show'
            )
    args = parser.parse_args()
    return args.test_name


if __name__ == '__main__':
    # execute the test
    _main()
