tests/test2
author Dmitriy Morozov <dmitriy@mrzv.org>
Wed, 08 Sep 2010 17:39:56 -0700
changeset 108 8befe33c55b1
parent 96 82aaeccffbec
child 111 e40251bf5a23
permissions -rwxr-xr-x
Autocompletion of options works for prefixes of full command names

#!/usr/bin/env python

from opster import command

a = 0

@command(usage="%name [-p|--pptx] [-x|--xslx] [-w|--wrdx] [-a|--abstract]")
def main(pptx=('p', False, 'should we generate pptx related code'),
         xslx=('x', False, 'should we generate xslx related code'),
         wrdx=('w', False, 'should we generate wrdx related code'),
         abstract=('a', False, 'should we generate abstract ifaces')):
    """
    Code generation tool. Run without params to regenerate all the code
    """
    global a
    a = 42

if __name__ == '__main__':
    main(argv=[])
    assert a == 42, "WTF???"