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
296 stars 147 forks source link

Optargs #44

Closed RobSanders closed 5 years ago

RobSanders commented 5 years ago

Add new cli_optarg type 'CLI_CMD_SPOT_CHECK'. This opt arg is placed in the evaluating chain immediately before a 'decision' point, and can be used to ensure that any required optargs have been seen/specified before proceeding with command execution. Note that the actual command callback is never called in this case. The clitest.c program has been tweaked to uses this. The test case is that at least one of the optinal arguments 'transparent' and 'color' needs to be set, but you cannot have both transparent and a color of 'black'. Also added 'show' and 'unset' to reserved words when generating a 'buildmode' environment, and a few tweaks to documentation.