#!/usr/local/bin/perl

# $Id: dvdrip,v 1.9 2002/01/27 11:39:33 joern Exp $

#-----------------------------------------------------------------------
# Copyright (C) 2001-2002 Jrn Reder <joern@zyn.de> All Rights Reserved
# 
# This program is part of Video::DVDRip, which is free software; you can
# redistribute it and/or modify it under the same terms as Perl itself.
#-----------------------------------------------------------------------

package Video::DVDRip;

use strict;
use lib 'lib';
use Getopt::Std;

use Video::DVDRip::GUI::Main;

my $USAGE = <<'_USAGE';

usage: dvdrip [-c] [-d level] [filename]

       -c open cluster control window
       -d set debugging level

_USAGE

main: {
	# get options
	my %opt;
	my $opt_ok = getopts ('cd:', \%opt);
	usage() if not $opt_ok;

	# fetch filename paramter
	my $filename = shift @ARGV;

	# no more args allowed
	usage() if @ARGV;

	# set requested debugging level
	Video::DVDRip::GUI::Main->set_debug_level( $opt{d} || 0 );

	# create GUI object
	my $gui = Video::DVDRip::GUI::Main->new;

	# start GUI
	$gui->start (
		filename	     => $filename,
		open_cluster_control => $opt{c}
	);


	END { Gtk->exit(0) }
}

sub usage {
	print $USAGE;
	exit 1;
}
