tool_getparam: switch to an enum for every option
To make the big switch much easier to read/understand and to make it easier to add new options.
This commit is contained in:
parent
1f4433dad4
commit
9e4e527735
1506
src/tool_getparam.c
1506
src/tool_getparam.c
File diff suppressed because it is too large
Load Diff
@ -190,8 +190,8 @@ while(<$r>) {
|
|||||||
$list=1;
|
$list=1;
|
||||||
}
|
}
|
||||||
elsif($list) {
|
elsif($list) {
|
||||||
if( /^ \{(\"[^,]*\").*((\"[^ ]*)\")/) {
|
if( /^ \{(\"[^,]*\").*\'(.)\', (.*)\}/) {
|
||||||
my ($l, $s)=($1, $2);
|
my ($l, $s, $rd)=($1, $2, $3);
|
||||||
my $sh;
|
my $sh;
|
||||||
my $lo;
|
my $lo;
|
||||||
my $title;
|
my $title;
|
||||||
@ -203,9 +203,9 @@ while(<$r>) {
|
|||||||
$lo = $1;
|
$lo = $1;
|
||||||
$title="--$lo";
|
$title="--$lo";
|
||||||
}
|
}
|
||||||
if($s =~ /\"(.)\"/) {
|
if($s ne " ") {
|
||||||
# a short option
|
# a short option
|
||||||
$sh = $1;
|
$sh = $s;
|
||||||
$title="-$sh, $title";
|
$title="-$sh, $title";
|
||||||
}
|
}
|
||||||
push @getparam, $title;
|
push @getparam, $title;
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user