Actions
Bug #5029
openvty: optional cases with multiple arguments is undefined behaviour
Status:
New
Priority:
Normal
Assignee:
-
Category:
libosmovty
Target version:
-
Start date:
02/16/2021
Due date:
% Done:
0%
Spec Reference:
Description
E.g.
DEFUN(cfg_ns_nse_nsvc_udp, cfg_ns_nse_nsvc_udp_cmd, "nsvc udp BIND " VTY_IPV46_CMD " <1-65535> [signalling-weight <0-254> data-weight <0-254>]"
results in an autocomplete of "[signalling-weigh". The missing t. However data-weight is ok again.
The follow patch with patchset 9 is showing this bug. https://gerrit.osmocom.org/c/libosmocore/+/22900/9/
Updated by fixeria over 3 years ago
I also faced this issue some time ago. The parser basically fails to handle constructions like:
command foo [zoo <0-123>]
so the only way (unless it's fixed) is to define two commands: with and without the optional part.
Updated by pespin over 3 years ago
I think the cases you mention here are simply not supported, and I'm not sure if we want to support them (I'm not saying I'm against it).
In any case, I see it is strange cmd parsing doesn't fail currently if no "]" is find at the end of the param.
Actions