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:
Daniel Stenberg 2024-01-08 17:00:05 +01:00
parent 1f4433dad4
commit 9e4e527735
No known key found for this signature in database
GPG Key ID: 5CC908FDB71E12C2
2 changed files with 878 additions and 680 deletions

File diff suppressed because it is too large Load Diff

View File

@ -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;