# Path: parm/_compat.py
# PY3 = sys.version_info[0] == 3
# PY2 = sys.version_info[0] == 2
# PY26 = sys.version_info[0:2] == (2, 6)
# PYPY = hasattr(sys, 'pypy_translation_info')
#     def reraise(tp, value, tb=None):
#     def u(s, encoding='utf8'):
#     def b(s):
#     def implements_iterator(cls):
#     def python_2_unicode_compatible(cls):
#     def u(s, encoding='utf8'):
#     def b(s, encoding='utf8'):
#     def exec_(code, globs=None, locs=None):
#     def next(it):
# def with_metaclass(meta, *bases):
#         def __new__(cls, name, this_bases, d):
# def import_(module, objects=None, via=None):
#     class metaclass(meta):


from ._compat import input, with_metaclass, string_types
from optparse import make_option, OptionParser, IndentedHelpFormatter
    from .commands import execute_command_line
import sys, os
import logging
import inspect
                    import traceback
        import shlex
            issubclass(c, Command) and c is not Command and c is not CommandManager)
    
    def find_mod_commands(mod):
        for name in dir(mod):
            c = getattr(mod, name)
            if check(c):
                register_command(c)
        
    def collect_commands():
        for m in modules:
            try:
                mod = __import__(m, fromlist=['*'])
            except ImportError as e:
                if not str(e).startswith('No module named'):
                    traceback.print_exc()
                continue
            
            find_mod_commands(mod)

    collect_commands()
    return __commands__
    
def register_command(kclass):
    global __commands__
    __commands__[kclass.name] = kclass

def call(prog_name, version, modules=None, args=None):
    
    modules = modules or []
    

# Path: parm/_compat.py
# PY3 = sys.version_info[0] == 3
# PY2 = sys.version_info[0] == 2
# PY26 = sys.version_info[0:2] == (2, 6)
# PYPY = hasattr(sys, 'pypy_translation_info')
#     def reraise(tp, value, tb=None):
#     def u(s, encoding='utf8'):
#     def b(s):
#     def implements_iterator(cls):
#     def python_2_unicode_compatible(cls):
#     def u(s, encoding='utf8'):
#     def b(s, encoding='utf8'):
#     def exec_(code, globs=None, locs=None):
#     def next(it):
# def with_metaclass(meta, *bases):
#         def __new__(cls, name, this_bases, d):
# def import_(module, objects=None, via=None):
#     class metaclass(meta):


# Path: parm/commands.py
from ._compat import input, with_metaclass, string_types
from optparse import make_option, OptionParser, IndentedHelpFormatter
    from .commands import execute_command_line
import sys, os
import logging
import inspect
                    import traceback
        import shlex

            issubclass(c, Command) and c is not Command and c is not CommandManager)
    
    def find_mod_commands(mod):
        for name in dir(mod):
            c = getattr(mod, name)
            if check(c):
                register_command(c)
        
    def collect_commands():
        for m in modules:
            try:
                mod = __import__(m, fromlist=['*'])
            except ImportError as e:
                if not str(e).startswith('No module named'):
                    traceback.print_exc()
                continue
            
            find_mod_commands(mod)

    collect_commands()
    return __commands__
    
def register_command(kclass):
    global __commands__
    __commands__[kclass.name] = kclass

def call(prog_name, version, modules=None, args=None):
    
    modules = modules or []
    

    if isinstance(args, string_types):