tool_getparam: reduce opt_string complexity

- move arguments taking unsigned numbers into opt_num

- move arugments taking seconds into opt_secs

Closes #21261
This commit is contained in:
Daniel Stenberg 2026-04-08 00:36:36 +02:00
parent 4c9af8b6d1
commit 80b2a5dd37
No known key found for this signature in database
GPG key ID: 5CC908FDB71E12C2
2 changed files with 136 additions and 91 deletions

View file

@ -317,8 +317,10 @@ typedef enum {
#define ARG_BOOL 1 /* accepts a --no-[name] prefix */
#define ARG_STRG 2 /* requires an argument */
#define ARG_FILE 3 /* requires an argument, usually a filename */
#define ARG_SECS 4 /* requires a time in seconds */
#define ARG_UNUM 5 /* requires a non-negative number */
#define ARG_TYPEMASK 0x03
#define ARG_TYPEMASK 0x07
#define ARGTYPE(x) ((x) & ARG_TYPEMASK)
#define ARG_DEPR 0x10 /* deprecated option */