def main():
echo = False<EOL>try:<EOL><INDENT>arguments = docopt(main.__doc__, help=True)<EOL>if arguments['<STR_LIT>']:<EOL><INDENT>arguments['<STR_LIT>'] = ['<STR_LIT>']<EOL>arguments['<STR_LIT>'] = '<STR_LIT:False>'<EOL><DEDENT>script_file = arguments['<STR_LIT>']<EOL>interactive = arguments['<STR_LIT>']<EOL>echo = arguments['<STR_LIT>']<EOL>if echo:<EOL><INDENT>pprint(arguments)<EOL><DEDENT><DEDENT>except:<EOL><INDENT>script_file = None<EOL>interactive = False<EOL>arguments = {'<STR_LIT>': True,<EOL>'<STR_LIT>': ['<STR_LIT:U+0020>'.join(sys.argv[<NUM_LIT:1>:])]}<EOL><DEDENT>plugins = []<EOL>plugins.append(dict(get_plugins_from_dir("<STR_LIT>", "<STR_LIT>")))<EOL>create_cmd3_yaml_file(force=False, verbose=False)<EOL>filename = path_expand("<STR_LIT>")<EOL>try:<EOL><INDENT>module_config = ConfigDict(filename=filename)<EOL>modules = module_config["<STR_LIT>"]["<STR_LIT>"]<EOL>properties = module_config["<STR_LIT>"]["<STR_LIT>"]<EOL><DEDENT>except:<EOL><INDENT>modules = ['<STR_LIT>']<EOL><DEDENT>for module_name in modules:<EOL><INDENT>try:<EOL><INDENT>plugins.append(dict(get_plugins_from_module(module_name)))<EOL><DEDENT>except:<EOL><INDENT>pass<EOL><DEDENT><DEDENT>for plugin in plugins:<EOL><INDENT>sys.path.append(os.path.expanduser(plugin['<STR_LIT>']))<EOL><DEDENT>sys.path.append("<STR_LIT>")<EOL>sys.path.append("<STR_LIT:.>")<EOL>sys.path.append("<STR_LIT:..>")<EOL>for plugin in plugins:<EOL><INDENT>plugin['<STR_LIT:class>'] += "<STR_LIT>"<EOL><DEDENT>name = "<STR_LIT>"<EOL>(cmd, plugin_objects) = DynamicCmd(name, plugins)<EOL>cmd.set_verbose(echo)<EOL>cmd.activate()<EOL>cmd.set_verbose(echo)<EOL>cmd.set_debug(properties["<STR_LIT>"])<EOL>if arguments['<STR_LIT>']:<EOL><INDENT>cmd.set_banner("<STR_LIT>")<EOL><DEDENT>if script_file is not None:<EOL><INDENT>cmd.do_exec(script_file)<EOL><DEDENT>if len(arguments['<STR_LIT>']) > <NUM_LIT:0>:<EOL><INDENT>try:            <EOL><INDENT>user_cmd = "<STR_LIT:U+0020>".join(arguments['<STR_LIT>'])<EOL>if echo:<EOL><INDENT>print("<STR_LIT:>>", user_cmd)<EOL><DEDENT>cmd.onecmd(user_cmd)<EOL><DEDENT>except Exception as e:<EOL><INDENT>Console.error("<STR_LIT>")<EOL>Console.error("<STR_LIT>".format(user_cmd))<EOL>Console.error("<STR_LIT>")<EOL>print (<NUM_LIT> * "<STR_LIT:=>")<EOL>print(e)<EOL>print (<NUM_LIT> * "<STR_LIT:=>")<EOL>print(traceback.format_exc())<EOL><DEDENT>if interactive:<EOL><INDENT>cmd.cmdloop()<EOL><DEDENT><DEDENT>elif not script_file or interactive:<EOL><INDENT>cmd.cmdloop()<EOL><DEDENT>
cm.

    Usage:
      cm [-q] help
      cm [-v] [-b] [--file=SCRIPT] [-i] [COMMAND ...]

    Arguments:
      COMMAND                  A command to be executed

    Options:
      --file=SCRIPT  -f  SCRIPT  Executes the script
      -i                 After start keep the shell interactive,
                         otherwise quit [default: False]
      -b                 surpress the printing of the banner [default: False]