From e324a39b04be463f0fa6021e5c5f26527ad3f082 Mon Sep 17 00:00:00 2001 From: Dima Kogan Date: Mon, 3 Jan 2011 12:08:34 -0800 Subject: [PATCH] handle cmdline option errors as soon as possible --- feedGnuplot.pl | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/feedGnuplot.pl b/feedGnuplot.pl index 5c5cdd3..9034687 100755 --- a/feedGnuplot.pl +++ b/feedGnuplot.pl @@ -169,6 +169,11 @@ GetOptions(\%options, 'help', 'dump') or die($usage); +if( defined $options{help} ) +{ + die($usage); +} + # set up plotting style my $style = ''; if($options{lines}) { $style .= 'lines';} @@ -176,12 +181,6 @@ if($options{points}) { $style .= 'points';} if(!$style) { $style = 'points'; } -if( defined $options{help} ) -{ - die($usage); -} - - # list containing the plot data. Each element is a reference to a list, representing the data for # one curve. The first 'point' is a hash describing various curve parameters. The rest are all # references to lists of (x,y) tuples