Ignore:
Timestamp:
11/25/08 17:55:31 (3 years ago)
Author:
bruno
Message:

fix option analysis in checkparams and a warning in a DEBUG print

File:
1 edited

Legend:

Unmodified
Added
Removed
  • devel/sshgw/bin/createsshuser

    r72 r73  
    5151            shift(@params) ; 
    5252            $expire = shift(@params) ; 
    53         } 
    54         if ($params[0] eq "-m") { 
     53        } elsif ($params[0] eq "-m") { 
    5554            shift(@params) ; 
    5655            $email = shift(@params) ; 
    57         } 
    58         if ($params[0] eq "-c") { 
     56        } elsif ($params[0] eq "-c") { 
    5957            shift(@params) ; 
    6058            $emailcc = shift(@params) ; 
    6159#           print "TEST: ccmail1: $emailcc\n"; 
     60        } else { 
     61            print STDERR "Unknown option $params[0]\n"; 
     62            &usage; 
    6263        } 
    63         print STDERR "Unknown option $params[0]\n"; 
    64         &usage; 
    6564    } 
    6665 
     
    8584    my ($username, $fullname, $groups, $expire, $email, $sshkey, $emailcc)= @_ ; 
    8685    my $group; 
    87     print "DEBUG: @_\n"; 
     86 
     87    print "DEBUG: "; 
     88    foreach my $i (@_) { 
     89        print "$i " if (defined $i); 
     90        print "undef " if (not defined $i); 
     91    } 
     92    print "\n"; 
    8893 
    8994    die "Username ($username) should be 9 lowercase letters or digits or less and begin with a letter\n" unless $username =~ /^[a-z][a-z0-9]{0,8}$/ ; 
Note: See TracChangeset for help on using the changeset viewer.