From: Tom Lane Date: Wed, 6 Jan 2010 22:02:45 +0000 (+0000) Subject: Make error messages for bad --set-version argument more useful. X-Git-Url: http://git.postgresql.org/gitweb/static/gitweb.js?a=commitdiff_plain;h=abdc91caffe20f96b2e0d11da25517d683fb717e;p=users%2Fandresfreund%2Fpostgres.git Make error messages for bad --set-version argument more useful. Per Stefan. --- diff --git a/src/backend/catalog/genbki.pl b/src/backend/catalog/genbki.pl index fa0de6070e..dc682388f6 100644 --- a/src/backend/catalog/genbki.pl +++ b/src/backend/catalog/genbki.pl @@ -40,9 +40,11 @@ while (@ARGV) { push @include_path, length($arg) > 2 ? substr($arg, 2) : shift @ARGV; } - elsif ($arg =~ /^--set-version=(\d+\.\d+)$/) + elsif ($arg =~ /^--set-version=(.*)$/) { $major_version = $1; + die "Version must be in format nn.nn.\n" + if !($major_version =~ /^\d+\.\d+$/); } else { @@ -53,7 +55,7 @@ while (@ARGV) # Sanity check arguments. die "No input files.\n" if !@input_files; die "No include path; you must specify -I at least once.\n" if !@include_path; -die "Version not specified or wrong format.\n" if !defined $major_version; +die "--set-version must be specified.\n" if !defined $major_version; # Make sure output_path ends in a slash. if ($output_path ne '' && substr($output_path, -1) ne '/')