curl: do more command line parsing in sub functions

This moves argument parsing logic for a number of options into sub
functions to reduce the overall complexity of the single getparameter()
function. pmccabe says it takes complexity down from 234 to 147.

The command line options that now has dedicated parser funtions are:

 --continue-at, --ech, --header, --localport, --output, --quote, --range
 --remote-name, --time-cond, --upload-file, --url, --verbose, --writeout

These parsers were selected for thise because they had more than 15
lines of logic in the main switch(). Detected like this:

 git grep -hn 'case C_' tool_getparam.c |
  cut -d: -f1 |
  awk '{if(($1 - prev) > 15) { printf "%d\n", prev;} prev = $1;}'

Closes #15680
This commit is contained in:
Daniel Stenberg 2024-12-04 10:23:47 +01:00
parent d95a89266b
commit 509f50e58d
No known key found for this signature in database
GPG key ID: 5CC908FDB71E12C2

File diff suppressed because it is too large Load diff