On 11/8/23 05:45, Érico Nogueira Rolim via Tech-talk wrote:
>
> This was an inconsistency I noticed in caget. The help output lists
> multiple DBR_...INT types as options for caget's -d option, but none of
> them work, because the dbr_text array from
> modules/ca/src/client/access.cpp includes only DBR_...SHORT strings.
> Would it be okay to simply remove the INT options from the help output
> entirely? Or should the tool try and replace "INT" for "SHORT", similar
> to how it adds "DBR_" when it doesn't find a match at first?
I had not noticed this before. I guess because DOUBLE and LONG are much more common.
Different case, though: DOUBLE and LONG do exist as separate different DBR_ type codes.
> $ caget -d INT some:name
> Requested dbr type out of range or invalid - ignored. ('caget -h' for help.)
...
Correcting the help message would be a good first step.
I would just silently replace "_INT" by "_SHORT" when reading the argument.
Since the _INT tag appears in header files and documentation, we would call for users asking why we don't support INT...
Note that the help message correctly shows the same numerical type for them - it just slipped that "INT" is not valid as the tag string.
Good catch!
~Ralph