def main(fw_name, args=None, items=None):
global DEBUG_LEVEL<EOL>global FRAMEWORK_NAME<EOL>debug_name = "<STR_LIT>" % fw_name.upper()<EOL>if debug_name in os.environ:<EOL><INDENT>try:<EOL><INDENT>DEBUG_LEVEL = int(os.environ.get(debug_name))<EOL><DEDENT>except ValueError:<EOL><INDENT>DEBUG_LEVEL = <NUM_LIT:10>  <EOL><DEDENT><DEDENT>FRAMEWORK_NAME = fw_name<EOL>if args is None:<EOL><INDENT>args = sys.argv[<NUM_LIT:1>:]<EOL><DEDENT>if items is None:<EOL><INDENT>items = list(globals().items())<EOL><DEDENT>yaclifw_parser, sub_parsers = parsers()<EOL>for name, MyCommand in sorted(items):<EOL><INDENT>if not isinstance(MyCommand, type):<EOL><INDENT>continue<EOL><DEDENT>if not issubclass(MyCommand, Command):<EOL><INDENT>continue<EOL><DEDENT>if MyCommand.NAME == "<STR_LIT>":<EOL><INDENT>continue<EOL><DEDENT>MyCommand(sub_parsers)<EOL><DEDENT>ns = yaclifw_parser.parse_args(args)<EOL>ns.func(ns)<EOL>if hasattr(ns, '<STR_LIT>'):<EOL><INDENT>if callable(ns.callback):<EOL><INDENT>ns.callback()<EOL><DEDENT>else:<EOL><INDENT>raise Stop(<NUM_LIT:3>, "<STR_LIT>")<EOL><DEDENT><DEDENT>
Reusable entry point. Arguments are parsed
via the argparse-subcommands configured via
each Command class found in globals(). Stop
exceptions are propagated to callers.

The name of the framework will be used in logging
and similar.