Fix '-s' option

This commit is contained in:
Quentin Garnier 2013-01-15 13:38:09 +01:00
parent 77434d86c7
commit 009bf015ee
1 changed files with 16 additions and 14 deletions

View File

@ -107,24 +107,26 @@ if ($opt_h) {
exit $ERRORS{'OK'};
}
if (!defined($opt_d)) {
print "Option -d (--disk) needed\n";
exit $ERRORS{'UNKNOWN'};
}
if (defined($opt_n) && !defined($opt_d)) {
print "Option -n (--name) need option -d (--disk)\n";
exit $ERRORS{'UNKNOWN'};
my $partition = 0;
if (!defined($opt_s)) {
if (!defined($opt_d)) {
print "Option -d (--disk) needed\n";
exit $ERRORS{'UNKNOWN'};
}
if ($opt_d =~ /([0-9]+)/ && !defined($opt_n)) {
$partition = $1;
} elsif (!$opt_n){
print "Unknown -d: number expected... try another disk - number\n";
exit $ERRORS{'UNKNOWN'};
}
if (defined($opt_n) && !defined($opt_d)) {
print "Option -n (--name) need option -d (--disk)\n";
exit $ERRORS{'UNKNOWN'};
}
}
$opt_a = 3 if (!$opt_a);
my $partition = 0;
if ($opt_d =~ /([0-9]+)/ && !defined($opt_n)) {
$partition = $1;
} elsif (!$opt_n){
print "Unknown -d: number expected... try another disk - number\n";
exit $ERRORS{'UNKNOWN'};
}
if (!$opt_c) {
$opt_c = 95;
}