dparrish / libcli

Libcli provides a shared library for including a Cisco-like command-line interface into other software. It's a telnet interface which supports command-line editing, history, authentication and callbacks for a user-definable function tree.
https://dparrish.com/link/libcli
GNU Lesser General Public License v2.1
289 stars 143 forks source link

CLI_CMD_OPTIONAL_FLAG does not honor user supplied completor callback #83

Closed RobSanders closed 1 year ago

RobSanders commented 1 year ago

As initially coded a CLI_CMD_OPTIONAL_FLAG item will only tab complete the name of the optional flag. This works for some arguments 'as-is', such as for a optarg named 'verbose'. However if there there are multiple acceptable 'answers' (true, True, yes, 1, verbose for example), the tab completion will not recognized them and this can impact parsing.

RobSanders commented 1 year ago

A fix has been introduced into the 1.10.8 staging branch.