tool_getparam: refactored, simplified

- add dedicated option functions for bools/none/strings
- simplify clearing (some) arguments, use '*' instead of ' '
- scripts/top-complexity: remove getparameter from whitelist
- handle --help separately
- getstr and getstrn do not allow a NULL input
- improve the ;auto check, it needs to be trailing
- add toggle bit helper function
- unify an error message for bad --no- use
- introduce generic handling of deprecated options: ARG_DEPR
- handle --no- prefix on more booleans:

    --cert-status
    --doh-cert-status
    --false-start
    --mptcp
    --ssl-no-revoke
    --ssl-revoke-best-effort
    --tcp-fastopen

Closes #17448
This commit is contained in:
Daniel Stenberg 2025-05-25 12:24:49 +02:00
parent 6eea7219a5
commit 698491f444
No known key found for this signature in database
GPG key ID: 5CC908FDB71E12C2
6 changed files with 1208 additions and 1233 deletions

View file

@ -62,8 +62,6 @@ const char *param2text(ParameterError error)
return "the given option cannot be reversed with a --no- prefix";
case PARAM_NUMBER_TOO_LARGE:
return "too large number";
case PARAM_NO_NOT_BOOLEAN:
return "used '--no-' for option that is not a boolean";
case PARAM_CONTDISP_RESUME_FROM:
return "--continue-at and --remote-header-name cannot be combined";
case PARAM_READ_ERROR: