#!/usr/bin/env python

#
# This is an extension to the Nautilus file manager to allow better 
# integration with the Subversion source control system.
# 
# Copyright (C) 2006-2008 by Jason Field <jason@jasonfield.com>
# Copyright (C) 2007-2008 by Bruce van der Kooij <brucevdkooij@gmail.com>
# Copyright (C) 2008-2008 by Adam Plumb <adamplumb@gmail.com>
# 
# RabbitVCS is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
# 
# RabbitVCS is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.
# 
# You should have received a copy of the GNU General Public License
# along with RabbitVCS;  If not, see <http://www.gnu.org/licenses/>.
#

import os.path
import sys
from rabbitvcs.lib.helper import launch_ui_window

usage = """usage: rabbitvcs <module> [path1] [path2] ...

Available Modules
------------------
about, add, blame, checkout, cleanup, commit, create, delete, export,
ignore, import, lock, log, merge, properties, relocate, rename,
resolve, revert, settings, switch, unlock, update, updateto

"""

if len(sys.argv) < 2:
    raise SystemExit(usage)

args = sys.argv[1:]
module = args.pop(0)

index = 0
for arg in args:
    args[index] = os.path.realpath(os.path.abspath(arg))
    index += 1

launch_ui_window(module,  ["--base-dir=" + os.getcwd()] + args)
