From: Martin Mares Date: Mon, 29 Oct 2007 09:10:24 +0000 (+0100) Subject: Fix arg parsing. X-Git-Url: http://mj.ucw.cz/gitweb/?a=commitdiff_plain;h=61335f6b01b4a783f9c6047ebe99ca813cb0492e;p=anim.git Fix arg parsing. --- diff --git a/goldberg.pl b/goldberg.pl index 417dbe6..c6258c7 100755 --- a/goldberg.pl +++ b/goldberg.pl @@ -13,7 +13,7 @@ use AA::Graph; use AA::Net; use AA::Anim; -my $anim = shift @ARGV; +my $show = shift @ARGV; my $output = shift @ARGV || ""; my $ui = AA::UI->new($output); @@ -77,7 +77,7 @@ sub hint($) { my $scenario; -if (!@ARGV || $ARGV[0] eq "1") { +if (!$show || $show eq "1") { $scenario = [ sub { }, sub { flow(0, 5); hint(1); }, @@ -88,7 +88,7 @@ if (!@ARGV || $ARGV[0] eq "1") { sub { up(3); }, sub { flow(3, 5); hint(-1); }, ]; -} elsif ($ARGV[0] eq "2") { +} elsif ($show eq "2") { $title->Set('text', "Goldberg v úzkých"); for (my $i=0; $i<@v-1; $i++) { $e[$i]->Set('c', 5-$i); @@ -135,7 +135,7 @@ if (!@ARGV || $ARGV[0] eq "1") { sub { flow(1, -1); hint(1); }, sub { flow(0, -1); hint(-1); }, ]; -} elsif ($ARGV[0] eq "3") { +} elsif ($show eq "3") { $title->Set('text', "Goldberg s nejvyšším vrcholem"); for (my $i=0; $i<@v-1; $i++) { $e[$i]->Set('c', 5-$i);