From: Martin Mares Date: Mon, 29 Oct 2007 09:05:33 +0000 (+0100) Subject: Improved command-line parsing. X-Git-Url: http://mj.ucw.cz/gitweb/?a=commitdiff_plain;h=118e309c349d09b7862465ab65a73859812ab45b;p=anim.git Improved command-line parsing. --- diff --git a/AA/UI.pm b/AA/UI.pm index 2b66016..f1d63b3 100644 --- a/AA/UI.pm +++ b/AA/UI.pm @@ -261,6 +261,7 @@ sub new($$) { sub RunScenario($$$) { my ($ui, $scenario) = @_; my $page = 0; + print "Rendering to PDF\n"; foreach my $s (@$scenario) { $page++; print "### Page $page ###\n"; @@ -291,6 +292,7 @@ sub RunScenario($$$) { my ($ui, $scenario) = @_; my $cairo = $ui->{CAIRO}; my $page = 0; + print "Rendering to PNG images\n"; foreach my $s (@$scenario) { $page++; print "### Page $page ###\n"; diff --git a/goldberg.pl b/goldberg.pl index c555a06..417dbe6 100755 --- a/goldberg.pl +++ b/goldberg.pl @@ -13,7 +13,10 @@ use AA::Graph; use AA::Net; use AA::Anim; -my $ui = AA::UI->new(''); +my $anim = shift @ARGV; +my $output = shift @ARGV || ""; + +my $ui = AA::UI->new($output); my $back = AA::Background->new('bg'); @@ -76,6 +79,7 @@ my $scenario; if (!@ARGV || $ARGV[0] eq "1") { $scenario = [ + sub { }, sub { flow(0, 5); hint(1); }, sub { up(1); }, sub { flow(1, 5); hint(2); }, @@ -90,6 +94,7 @@ if (!@ARGV || $ARGV[0] eq "1") { $e[$i]->Set('c', 5-$i); } $scenario = [ + sub { }, sub { flow(0, 5); hint(1); }, sub { up(1); }, sub { flow(1, 4); hint(2); }, @@ -136,6 +141,7 @@ if (!@ARGV || $ARGV[0] eq "1") { $e[$i]->Set('c', 5-$i); } $scenario = [ + sub { }, sub { flow(0, 5); hint(1); }, sub { up(1); }, sub { flow(1, 4); },