def main(args=None):
parser = ArgumentParser(<EOL>prog='<STR_LIT>',<EOL>description=DESCRIPTION)<EOL>parser.add_argument(<EOL>'<STR_LIT:path>', nargs='<STR_LIT:*>',<EOL>help='<STR_LIT>')<EOL>parser.add_argument(<EOL>'<STR_LIT>', help='<STR_LIT>')<EOL>parser.add_argument(<EOL>'<STR_LIT>', '<STR_LIT>', action='<STR_LIT:store_true>',<EOL>help='<STR_LIT>')<EOL>args = parser.parse_args(args)<EOL>paths = args.path or ['<STR_LIT:.>']<EOL>paths = [path for pattern in paths for path in glob(pattern)]<EOL>if args.walk:<EOL><INDENT>for dirpath in (p for p in paths if os.path.isdir(p)):<EOL><INDENT>for root, _dirs, files in os.walk(dirpath):<EOL><INDENT>paths += (os.path.join(root, filename) for filename in files)<EOL><DEDENT><DEDENT><DEDENT>else:<EOL><INDENT>for dirpath in (p for p in paths if os.path.isdir(p)):<EOL><INDENT>paths += (os.path.join(dirpath, pth) for pth in os.listdir(dirpath))<EOL><DEDENT><DEDENT>update_paths = [<EOL>os.path.relpath(p) for p in paths if p.lower().endswith(UPDATE_EXT)]<EOL>exitcode = <NUM_LIT:0><EOL>if update_paths:<EOL><INDENT>script_paths = [pth[:-len(UPDATE_EXT)] + '<STR_LIT>' for pth in update_paths]<EOL>print('<STR_LIT>')<EOL>for path in script_paths:<EOL><INDENT>print('<STR_LIT:U+0020>' + path)<EOL><DEDENT>print()<EOL>if not args.movepath:<EOL><INDENT>try:<EOL><INDENT>input('<STR_LIT>')<EOL><DEDENT>except KeyboardInterrupt:<EOL><INDENT>print()<EOL>print('<STR_LIT>')<EOL>exitcode = <NUM_LIT:1><EOL><DEDENT>else:<EOL><INDENT>print()<EOL><DEDENT><DEDENT>if exitcode == <NUM_LIT:0>:<EOL><INDENT>for script_path, update_path in zip(script_paths, update_paths):<EOL><INDENT>if args.movepath:<EOL><INDENT>script_path = os.path.join(args.movepath, script_path)<EOL>if update_path.startswith('<STR_LIT:..>'):<EOL><INDENT>raise RuntimeError(<EOL>'<STR_LIT>' + script_path)<EOL><DEDENT>script_dirpath = os.path.dirname(script_path)<EOL>if not os.path.isdir(script_dirpath):<EOL><INDENT>os.makedirs(script_dirpath)<EOL><DEDENT><DEDENT>with open(update_path) as update:<EOL><INDENT>new_content = update.read()<EOL><DEDENT>with open(script_path, '<STR_LIT:w>') as script:<EOL><INDENT>script.write(new_content)<EOL><DEDENT>os.remove(update_path)<EOL>print(update_path + '<STR_LIT>' + script_path)<EOL><DEDENT><DEDENT><DEDENT>return exitcode<EOL>
Command line interface.

    :param list args: command line options (defaults to sys.argv)
    :returns: exit code
    :rtype: int