#!/usr/bin/perl -w
# Quest, a computer role playing game system
# Copyright (C) 2002 Willem Robert van Hage, details in the COPYING file.

use strict;
use Getopt::Long; 
use tk_io;
use text_io;

my $help = 0;

my $usage = <<END_OF_USAGE;
Usage: $0 [OPTIONS]...
Starts the Quest client with the given parameters.
  -h IP,   --host IP         the ip address of the server (default = localhost)
  -p PORT, --port PORT       the port number of the server (default = 4242)
  -f NAME, --front-end NAME  the name of the front-end to use,
                             possible values: tk, text (default = tk)
  -c,      --color           turn on ansi color in the text front-end
  -?,      --help            display this help and exit

Report bugs to <wrvh\@xs4all.nl>.
END_OF_USAGE

GetOptions('help|?' => \$help,
           'host=s' => \(my $server = "localhost"),
           'port=i' => \(my $port = 4242),
		   'front-end=s' => \(my $front_end = "tk"),
		   'color' => \(my $color = 0)) or die "can't parse options";

if ($help) { print $usage; exit }

if ($front_end =~ /tk/) { 
	tk_io::init($server,$port) 
} else { 
	text_io::init($server,$port,$color) 
}

