Index: trunk/start
===================================================================
--- trunk/start	(revision 93)
+++ trunk/start	(revision 94)
@@ -5,11 +5,21 @@
 use lib "$FindBin::RealBin/lib";
 
+use Getopt::Long;
+use YAML;
 use Plack::Runner;
 use BookmarksApp;
 
-my $CONFIG_FILE = shift || 'conf.yml';
-my $app = BookmarksApp->new({ config_file => $CONFIG_FILE })->to_app;
+GetOptions(
+    'file=s' => \my $CONFIG_FILE,
+);
+
+$CONFIG_FILE ||= 'conf.yml';
+-e $CONFIG_FILE or die "Config file $CONFIG_FILE not found\n";
+my $config = YAML::LoadFile($CONFIG_FILE);
+my $app = BookmarksApp->new({ config => $config })->to_app;
+
+my $listen = ':' . ($config->{port} || 5000);
 
 my $runner = Plack::Runner->new(server => 'Starman');
-$runner->parse_options(qw{--listen :5000 --daemonize --pid pid --error-log errors --access-log access});
+$runner->parse_options(qw{--listen}, $listen, qw{--daemonize --pid pid --error-log errors --access-log access});
 $runner->run($app);
