A Command-Line Interface (CLI) for use in C++ programs.
The purpose of this project is to provide C++ programmers with a Command-Line Interface which they can tie into their existing projects. This seeks to allow connecting to your application via the local process or via a TCP socket.
All arguments are controlled via a configuration file which consists of several internal CLI commands plus the user-defined commands. The command name, arguments, types, and response expectations can be provided.
CLI-CPP has some basic requirements. I have only tested this on Linux (Ubuntu/Fedora) and MacOS X with MacPorts
- Boost
- pthreads (
std::thread
) - pugixml
First, you must pull the pugixml dependencies. From the project directory, call the following...
git submodule update --init src/lib/cli_cpp/thirdparty/pugixml
CLI-CPP is constructed using the CMake build system. Do the following.
mkdir -p release
pushd release
cmake ..
make
popd
Documentation can be constructed using Doxygen with
doxygen docs/Doxyfile
Unit-tests require some test data in order to fully checkout the library. As a result, you need to run the unit tests from the project's base directory. To run,
./scripts/run-unit-tests.sh [options]
CLI-CPP comes with a basic test application to demonstrate core capabilities. To run...
cd release
./bin/cli-network-tester ../data/CLI_Manager_Configuration.xml
# On a separate terminal,
telnet localhost 12344
For the demo, the supported commands are shown below. Tab-complete works for both commands and arguments. Check the configuration file for arguments with tab-complete support.
- system-shutdown
- Shut down application.
- ping
- ping a network address.
- netstat
- check if a port is open.