This 'Hello world' example shows the direct relationship
between the XML resource file and the CLI execution of the user-defined function 'sayHello()' for instance.
Here is list of the main features of the CLI toolkit:
The user can use left and right arrows, begin and end, delete and backspace keys for command line edition.
The user can use up and down arrows to navigate through the command line history.
Completion and help:
The user has facilities to get into the set of commands.
The CLI toolkit automatically manages completion,
and help can be set for every keyword and parameter.
User-defined commands can give access to user-defined menus,
which may contain other sets of user-defined commands,
and so on...
XML resource file:
All the command lines syntax can be described in an XML resource file, natively managing keywords, parameters, tags...
This XML resource file provides the ability to directly insert the final native calls attached to each command,
making the link with a global application.
Automatic documentation generation:
Based on the XML resource file, the CLI toolkit provides a stylesheet automatically generating CLI documentations.
Input/output can be easily redirected.
The CLI toolkit currently gives support for the following regular input/output devices:
console, telnet connections, files and strings.
But you may implement your own intput/output device for your special needs.
An inner traces management system is available with the toolkit.
How does it work?
Considering you already have the user code to execute at end,
all you have to do is the following:
Edit an XML resource file;
Transform the XML resource file into target language code;
Integrate the result of the transformation.
Please refer to the user guide for detailed instructions.
Here is a list of possible interests you could have in this projects:
Text-based user interface:
The CLI toolkit basically aims to implement text-based user interfaces.
Graphical user interfaces are generally more attractive,
however text-based interfaces also have their advantages:
few means prerequesits,
integration facilities (see automation below),
Monitoring and debug:
It is sometimes useful to have a secondary user interface,
to monitor and debug an application.
You can easily define a specific configuration file syntax with the CLI toolkit.
Therefore, you could use it instead of .ini or XML files.
Since CLI is text-based, it is compatible with automation.
Automated test tools generally need to interact with tested equipments or softwares.
The CLI toolkit is an easy way to implement an entry point on target equipments for unit tests.
The CLI toolkit can be used for its command line parsing ability,
making by that way compilers of simple syntaxes.
This open source software, written by Alexis Royer, is provided under BSD-like license.
Bug(minor)! C++: Crash in Traces::UnsetStream when streams are unset in the wrong order (trace output consistency improvement)
Bug(minor)! C++: telnet unit test does not compile on certain configurations (#include <stdio.h> changed into #include <unistd.h> for close() definition)
Bug(minor)! C++: OutputDevice::operator<<(void*) format improvements for better compatibility with 64 bits compilers
Bug(minor)! C++: Build info when building in debug under Cygwin
Info: resolving _ESCDELAY by linking to __imp__ESCDELAY (auto-import)
Info: resolving _stdscr by linking to __imp__stdscr (auto-import)
Info: resolving _LINES by linking to __imp__LINES (auto-import)
Info: resolving _COLS by linking to __imp__COLS (auto-import)
Bug(minor)! _mkres.mak: bad force rule on $(CLI_CPP_LIB): dependencies always relink the applications
Bug(major)! Java: "Java faile while executing command: 'cls'" => well-known command control 'cls' missing in NativeMenu.cpp
Bug(minor)! Java: java.lang.UnsatisfiedLinkError: __Native__getScreenInfo at cli.OutputDevice.__Native__getScreenInfo(Native Method)
(visible when the getScreenInfo() is called from Java,
fixed and checked with I/O devices unit test: java/build/make/io_device.mak, java/src/cli/test/TestIODevice.java)
Bug(minor)! Java: Crash on Endl deletion with MenuRef reference set (visible when calling deprecated System.runFinalizersOnExit(true))
Bug(minor)! Java: Native object references misfunctionning when declaring twice a same keyword in the same context (fixed and checked with test_no_res.mak)
Bug(minor)! Java: Crash when calling deprecated System.runFinalizersOnExit(true) (token addition for static null/stdin/stdout/stderr devices)
Bug(minor)! Java: Crash when calling deprecated System.runFinalizersOnExit(true) (no more finalization for TraceClass("CLI_JNI") main instance)
Bug(minor)! cli2cpp.xsl/cli2java.xsl: accented character management in T_MkCppName/T_MkJavaName
Bug(minor)! cli2java.xsl: Explicit java.lang/java.util package specification (avoid possible conflicts)
Bug(minor)! cli2help.xsl: Forward tag commands do not appear in documentation (T_Recursion|CHECK_MENU fix)
Bug(minor)! cli2help.xsl: Wrong default description for forward tag options.
Bug(minor)! cli2help.xsl: Space missing in command names (due to xsltproc limitation?)
Bug(minor)! cli2help.xsl: wrong number of options generated for (a|b)+ patterns while (a|b)* works fine.
Work around: cli2help.xsl still unfixed, but cli2help.py provides a fix.
The former LGPL license has been abandoned for a BSD-like license.
This is the decision of the author (myself) in order to have fewer constraints
on using and modifying the toolkit in any kind of softwares (even commercial ones),
which is what I wanted initially.
The following charts gives the evolution of the number of code lines throughout the time:
To my point of view, the major aims of the CLI toolkit have been reached so far, and I'm quite proud of that.
That's the reason why there are not many modifications expected in the next times.
But once again, if you feel the need for any other evolution, please .
Other target languages:
Supported languages are C++ and Java at present.
Next ones could be Perl or python...
Implement memory pools in order to provide better memory management with embedded integration contexts.
Latest version of the CLI toolkit is 2.8.
Please refer to history section for previous downloads.