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