#!/usr/bin/env python
# vim: set filetype=python

import os
import sys
import git
from bigstore import push, pull, filter_clean, filter_smudge, init, log

def print_help():
    print """usage: git bigstore init|push|pull|log

    init			initialize a repository to use bigstore
    push			upload all bigstore files to your storage backend
    push <filepattern>...	same as "push", but only apply to specified patterns
    pull			download all bigstore files from your storage backend
    pull <filepattern>...	same as "pull", but only apply to specified patterns
    log <filename>		display a history of the specified file
"""

length = len(sys.argv)

if __name__ == "__main__":
    if length == 1:
        print_help()
    elif sys.argv[1] == "init":
        init()
    elif sys.argv[1] == "push":
        push()
    elif sys.argv[1] == "pull":
        pull()
    elif sys.argv[1] == "log":
        log()
    elif sys.argv[1] == "filter-clean":
        filter_clean()
    elif sys.argv[1] == "filter-smudge":
        filter_smudge()
    else:
        print_help()

