#!/usr/bin/env python
# Generated automatically from garchiver.in by configure.

''' -*- python -*-                       vim:set tw=4 sw=4:

    FILE: "/home/life/projects/garchiver-0.5/src/garchiver.in"
    LAST MODIFICATION: "Tue, 26 Jun 2001 01:09:46 +0200 (life)"

    (C) 2000 by Danie Roux <droux@tuks.co.za>

    $Id: garchiver.in,v 1.5 2001/06/27 11:00:25 droux Exp $
'''

import sys, os

if sys.version < '1.5.2':
    sys.stderr.write ("This was written for Python 1.5.2. \
Don't think this will work. If it does, mail me at droux@tuks.co.za\n")

GARCHIVER_LIBDIR = '/usr/lib/garchiver'
GARCHIVER_VERSION = '0.5'

dir = os.path.join (sys.path [0], GARCHIVER_LIBDIR)

if os.path.isdir (dir):
    sys.path.insert (1, dir)
else:
    sys.stderr.write ("Can't seem to find the libraries in %s!\n" % dir)

args = [] + sys.argv

TRUE = 1
FALSE = 0

Start_with_classic = Start_with_tree = FALSE

# The name of the executing program
try: del args [0]
except: pass

for arg in args:
    if arg == '--classic':
        Start_with_classic = TRUE
        del args [0]
    elif arg == '--tree':
        Start_with_tree = TRUE
        del args [0]
    elif arg == '--help':
        print
        print 'garchiver version ' + GARCHIVER_VERSION
        print
        print 'Usage: '
        print '        garchiver --classic <file>'
        print '        garchiver --tree <file1> <file2> ...'
        print
        print '--classic    starts with classic interface'
        print '--tree       starts with tree interface'
        print 
        print 'See the manpage for more information'
        print
        sys.exit ()
    elif arg == '--version':
        print
        print 'garchiver version ' + GARCHIVER_VERSION
        print
        sys.exit ()

try: sys.argv [1] = ''
except: pass

import garchiver
if Start_with_tree: garchiver.run (args, start_with_tree=TRUE)
elif Start_with_classic: garchiver.run (args, start_with_classic=TRUE)
else: garchiver.run (args)
