#!/usr/bin/env ruby

#*******************************************************************************#
#                                                                               #
#                            E A S I N S T A L L E R                            #
#                                                                               #
#*******************************************************************************#
# Copyright (C) 2004 by Yuri Leikind.                                           #
#*******************************************************************************#
# This program 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                          #
#                                                                               #
# This program 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 this program; if not, write to the Free Software           #
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA.    #
#*******************************************************************************#
# $Id: easinstaller,v 1.26 2004/07/13 12:34:36 leikind Exp $                    #
#*******************************************************************************#


VERSION_ = "0.5"

cli_dir  = nil
cli_file = nil

ARGV.each do |arg|
    case arg
    when "-v", "-V", "--version", "-version"
        puts "Easinstaller version " + VERSION_
        exit 0
    when "-h", "-help", "--help"
        puts <<ZZZ
easinstaller [path to source arhive or directory]   launch easinstaller
easinstaller --version                              easinstaller version
easinstaller --help                                 this help message
ZZZ
        exit 0
    else
        if FileTest.directory?(arg)
            if cli_dir != nil or cli_file != nil
                STDERR.puts "Cannot process more than one source package at a time!"
                exit 2
            end
            cli_dir = arg
        elsif FileTest.file?(arg)
            if cli_dir != nil or cli_file != nil
                STDERR.puts "Cannot process more than one source package at a time!"
                exit 2
            end
            cli_file = arg
        else
            STDERR.puts "File or directory '#{arg}' not found!"
            exit 3
        end
    end
end

require "singleton.rb"
require "ui/signals.rb"
require "core/core.rb"
require "core/auth.rb"


require "app_toolkit/application.rb"

require "ui/about.rb"
require "ui/command_list.rb"
require "ui/password_dialog.rb"
require "ui/tools.rb"
require "ui/easinstaller.rb"
require "ui/actions.rb"
require "ui/session_list.rb"
require "ui/program_settings.rb"


UI::EasinstallerApp.new(cli_dir, cli_file)

