From d9f8922dfbdad0496486aab8d2c2005f68342b96 Mon Sep 17 00:00:00 2001 From: Ian Jackson Date: Thu, 5 Sep 2013 00:39:04 +0100 Subject: [PATCH] alphanum tidyups --- service | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/service b/service index d3e0499..bbcc43b 100755 --- a/service +++ b/service @@ -2,12 +2,13 @@ our $usage1 = <<'END'; usage: ../fyvzl [] ... options - -l (for create/choose, minimum randlength) -m -d -q -C (show comments in output) -h (display help) +options for alphanum generation + -l (for create/choose alphanum, minimum randlength) END our $usage2 = <<'END'; actions @@ -29,7 +30,7 @@ default generation method is alphanum END our %usage_genopts = ( 'alphanum' => < (number of letters+digits) + -l (number of letters+digits) END ); #/ @@ -39,8 +40,6 @@ use strict; use DBI; use POSIX; -our $randlength; - our $maxperuser = 10000; our $qualdom; our $dbh; @@ -51,8 +50,11 @@ our $showcomment; our $genmethod = 'alphanum'; # for alphanum +# options our $minrandlength = 6; -our $maxrandlength = 50; +our $maxrandlength = 100; +# genopts +our $randlength; sub nextarg () { die "too few arguments\n" unless @ARGV; @@ -206,7 +208,7 @@ sub prepare_create () { sub genopt_alphanum { local ($_) = @_; if (m/^-l(\d+)$/) { - $randlength = $1; + $randlength = 0+$1; die "length out of range $minrandlength..$maxrandlength\n" unless ($minrandlength<=$randlength && $randlength<=$maxrandlength); -- 2.30.2