#!/usr/bin/env python

'''
This file is part of DoctestAll.

DoctestAll is free software: you can redistribute it and/or modify it
under the terms of the GNU Lesser Public License as published by the 
Free Software Foundation, either version 3 of the License, or (at 
your option) any later version.

DoctestAll is distributed in the hope that it will be 
useful, but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU Lesser Public License for more details.

You should have received a copy of the GNU Lesser Public License
along with DoctestAll.  If not, see 
<http://www.gnu.org/licenses/>.
'''

from doctestall import *

if __name__ == "__main__":
    import argparse
    parser = argparse.ArgumentParser(description='Recursively test a module with doctest.')
    parser.add_argument('-l', action='store_true', help='Print a line on every recursive import')
    parser.add_argument('modname', nargs=1, help='Name of module to test')

    args = parser.parse_args()
    failures, tests = test_toplevel(args.modname[0], args.l)
    quit(1 if failures else 0)
