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;
|
||||
}
|
||||
elsif($list) {
|
||||
if( /^ \{(\"[^,]*\").*((\"[^ ]*)\")/) {
|
||||
my ($l, $s)=($1, $2);
|
||||
if( /^ \{(\"[^,]*\").*\'(.)\', (.*)\}/) {
|
||||
my ($l, $s, $rd)=($1, $2, $3);
|
||||
my $sh;
|
||||
my $lo;
|
||||
my $title;
|
||||
@ -203,9 +203,9 @@ while(<$r>) {
|
||||
$lo = $1;
|
||||
$title="--$lo";
|
||||
}
|
||||
if($s =~ /\"(.)\"/) {
|
||||
if($s ne " ") {
|
||||
# a short option
|
||||
$sh = $1;
|
||||
$sh = $s;
|
||||
$title="-$sh, $title";
|
||||
}
|
||||
push @getparam, $title;
|
||||
|
||||
Loading…
Reference in New Issue
Block a user