#! /usr/bin/env python2
# -*- coding: utf-8 -*-
#
# Interpreter version: python 2.7
#
import sys
import os.path
import argparse

# don't try to import yourself
sys.path = [x for x in sys.path if x != "." and x != os.path.dirname(__file__)]
from rdiff_trimmer import main


if __name__ == '__main__':
    parser = argparse.ArgumentParser()
    parser.add_argument(
        "-k",
        "--keep-increments",
        dest="list",
        help="Keep only increments listed in this file."
    )
    parser.add_argument(
        "-o",
        "--one-for-each-month",
        dest="each_month",
        action="store_true",
        help="Keep only one backup for each month."
    )
    parser.add_argument(
        "-e",
        "--remove-even",
        action="store_true",
        help="Remove even backups. Reduce number of backups to half."
    )
    parser.add_argument(
        "-d",
        "--disable-compression",
        action="store_true",
        help="Disable default gzip compression used by rdiff."
    )
    parser.add_argument(
        "rsync_dir",
        metavar="RSYNC_DIR",
        help="Path to the rsync directory."
    )
    parser.add_argument(
        "out_dir",
        default=None,
        nargs='?',
        metavar="OUT_DIR",
        help=(
            "Path to the trimmed OUTPUT rsync directory. "
            "Default `{{RSYNC_DIR}}_trimmed`."
        )
    )

    args = parser.parse_args()
    main(args)
