#!/usr/bin/env python

import sys
import os

sys.path.append(os.path.join(os.path.dirname(__file__), '..'))

from lib.views import do_play, do_back, do_set

def help():
    print """ You must specify a command

    {command_name} play
    {command_name} back
    {command_name} set

    This controls mplayer, allowing easy viewing of series.

    PLAY:
        Play the next video
    BACK:
        Go back one video in the current series
    SET:
        Set the current folder as the current series.
        All playable files reachable from this folder will be considered when
        playing.
    """

if len(sys.argv) < 2:
    help()
else:
    command = sys.argv[1]

    if command == 'play':
        do_play()
    elif command == 'back':
        do_back()
    elif command == 'set':
        do_set()
    else:
        help()

# vim: set ai et sw=4 syntax=python :
