#!/usr/bin/perl

use lib './lib';

use strict;
use Data::Dumper;
use OpenFrame::Config;

if ($ARGV[0]) {
  OpenFrame::Config->sourceFile()->[0] = $ARGV[0];
} else {
  print "usage: configbuilder <filename>\n";
  exit;
}

my $config = OpenFrame::Config->new($ARGV[0] || '/etc/openframe.conf');
$config->setKey(
		'SLOTS',
	        [
		 {
		  dispatch => 'Local',
		  name     => 'OpenFrame::Slot::Session',
		  config   => {
			       'default_session' => {
						     language => 'en',
						     country  => 'UK',
						     application => {},
						    },
			       'directory' => '/tmp/openframe2',
			      }
		 },
		 {
		  dispatch => 'Local',
		  name     => 'OpenFrame::Slot::Dispatch',
		  config   => {
			       'installed_applications' => [
							    {
							     name      => 'default',
							     uri       => '/',
							     dispatch  => 'Local',
							     namespace => 'OpenFrame::Application',
							    }
							   ]
			      },
		 },
		]
	       );

$config->setKey(
		'DEBUG',
		1
	       );


$config->writeConfig();
