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 144 forks source link

Optargs #45

Closed RobSanders closed 5 years ago

RobSanders commented 5 years ago

Added new 'CLI_CMD_SPOT_CHECK' optarg to allow for sanity checking of required optargs before proceeding with command line evaluation. The developer would insert a spot check before any place in the evaluation of arguments where evaluation should not continue if the required optarg state is incorrect.
The clitest.c program show this. Before entering the 'shape' optarg we need to have at least one of 'transparent' and 'color' set, but we can not have 'transparent' if 'color' is set to 'black'. Added show/unset to the restricted commands when trying to enter buildmode, and made some comment changes.