Skip to content

marvins/cli-cpp

Repository files navigation

CLI-C++

Build Status

A Command-Line Interface (CLI) for use in C++ programs.

Overview

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.

Building

CLI-CPP has some basic requirements. I have only tested this on Linux (Ubuntu/Fedora) and MacOS X with MacPorts

Dependencies

  • Boost
  • pthreads (std::thread)
  • pugixml

Compiling

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

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]

Test Application

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.

  1. system-shutdown
  • Shut down application.
  1. ping
  • ping a network address.
  1. netstat
  • check if a port is open.

CLI Main Window

CLI Main Window

CLI Help Menu (?, help)###

CLI Help Window

CLI Ping Command

CLI Ping Command

CLI Ping Command Complete

CLI Ping Command

Pause Command

CLI Pause Command

Sleep Command

CLI Sleep Command

About

Command-Line Interface (CLI) written for C++ which you connect your application to.

Resources

License

MIT, Unknown licenses found

Licenses found

MIT
LICENSE
Unknown
LICENSE.md

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published