def main():
    parser = argparse.ArgumentParser(
        description='Automatically copy new replays to directory',
        fromfile_prefix_chars='@',
        formatter_class=sc2reader.scripts.utils.Formatter.new(max_help_position=35),
        epilog="And that's all folks")

    required = parser.add_argument_group('Required Arguments')
    required.add_argument('source', type=str,
        help='The source directory to poll')
    required.add_argument('dest', type=str,
        help='The destination directory to copy to')

    general = parser.add_argument_group('General Options')
    general.add_argument('--mode', dest='mode',
        type=str, choices=['BATCH', 'CYCLE'], default='BATCH',
        help='The operating mode for the organizer')

    general.add_argument('--action', dest='action',
        choices=['COPY', 'MOVE'], default="COPY", type=str,
        help='Have the organizer move your files instead of copying')
    general.add_argument('--period',
        dest='period', type=int, default=0,
        help='The period of time to wait between scans.')
    general.add_argument('--log', dest='log', metavar='LOGFILE',
        type=argparse.FileType('w'), default=sys.stdout,
        help='Destination file for log information')
    general.add_argument('--dryrun',
        dest='dryrun', action="store_true",
        help="Don't do anything. Only simulate the output")
    general.add_argument('--reset',
        dest='reset', action='store_true', default=False,
        help='Wipe the destination directory clean and start over.')

    fileargs = parser.add_argument_group('File Options')
    fileargs.add_argument('--depth',
        dest='depth', type=int, default=-1,
        help='Maximum recussion depth. -1 (default) is unlimited.')
    fileargs.add_argument('--exclude-dirs', dest='exclude_dirs',
        type=str, metavar='NAME', nargs='+', default=[],
        help='A list of directory names to exclude during recursion')
    fileargs.add_argument('--exclude-files', dest='exclude_files',
        type=str, metavar='REGEX', default="",
        help='An expression to match excluded files')
    fileargs.add_argument('--follow-links',
        dest='follow_links', action="store_true", default=False,
        help="Enable following of symbolic links while scanning")

    renaming = parser.add_argument_group('Renaming Options')
    renaming.add_argument('--rename',
        dest='rename', type=str, metavar='FORMAT', nargs='?',
        default="{length} {type} on {map}",
        help='''\
            The renaming format string. can have the following values:

                * {length} - The length of the replay ([H:]MM:SS)
                * {type} - The type of the replay (1v1,2v2,4v4,etc)
                * {map} - The map that was played on.
                * {match} - Race matchup in team order, alphabetically by race.
                * {date} - The date the replay was played on
                * {teams} - The player line up
        ''')

    renaming.add_argument('--length-format',
        dest='length_format', type=str, metavar='FORMAT', default='%M.%S',
        help='The length format string. See the python time module for details')
    renaming.add_argument('--player-format',
        dest='player_format', type=str, metavar='FORMAT', default='{name} ({play_race})',
        help='The player format string used to render the :teams content item.')
    renaming.add_argument('--date-format',
        dest='date_format', type=str, metavar='FORMAT', default='%m-%d-%Y',
        help='The date format string used to render the :date content item.')
    '''
    renaming.add_argument('--team-order-by',
        dest='team_order', type=str, metavar='FIELD', default='NUMBER',
        help='The field by which teams are ordered.')
    renaming.add_argument('--player-order-by',
        dest='player_order', type=str, metavar='FIELD', default='NAME',
        help='The field by which players are ordered on teams.')
    '''
    renaming.add_argument('--favored', dest='favored',
        type=str, default=[], metavar='NAME', nargs='+',
        help='A list of the players to favor in ordering teams and players')

    filterargs = parser.add_argument_group('Filtering Options')
    filterargs.add_argument('--filter-rule', dest='filter_rule',
        choices=["ALLOW","DENY"],
        help="The filters can either be used as a white list or a black list")
    filterargs.add_argument('--filter-player', metavar='NAME',
        dest='filter_player', nargs='+', type=str, default=[],
        help="A list of players to filter on")

    try:
        run(parser.parse_args())
    except __HOLE__:
        print "\n\nScript Interupted. Process Aborting"
dataset/ETHPy150Open GraylinKim/sc2reader/examples/sc2autosave.py/main