Version 2.9:
A couple of years I had not been back to this project.
What I thought would be a minor update eventually came to be a major release :-)
Various contributions, comment line patterns, 64bits port for Java...
>>>
[changes][download]
<<<
July, 15th 2013
Version 2.8:
Major improvements.
Execution contexts and faster python transformation tools.
Dec, 9th 2011
Version 2.7:
You guys start contributing and that's GREAT!
Text edition facilities, and many other improvements (non blocking execution, telnet...)
...
Oct, 1st 2009
Sourceforge registration
>>> [aroyer-cli] <<<
(The main location of the project remains this page).
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:
Edition facilities:
The user can use left and right arrows, begin and end, delete and backspace keys for command line edition.
History:
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.
Menus:
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.
Generic input/output:
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.
Traces:
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.
Main interests
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,
fast execution,
integration facilities (see automation below),
analysis facilities...
Monitoring and debug:
It is sometimes useful to have a secondary user interface,
to monitor and debug an application.
Configuration files:
You can easily define a specific configuration file syntax with the CLI toolkit.
Therefore, you could use it instead of .ini or XML files.
Automation:
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.
Simple compilers:
The CLI toolkit can be used for its command line parsing ability,
making by that way compilers of simple syntaxes.
License
This open source software, written by Alexis Royer, is provided under BSD-like license.
Bug(major)! Java cli.dll does not compile anymore with g++ (GCC) 4.7.3 (-mno-cyygwin unknown option)
Bug(major)! TelnetServer: TelnetServer lost clients were not correctly unregistered (Dinesh Balasubramaniam's contribution)
This caused frenzy loops on select() calls with tk_stl implementation
TelnetServer could even accept no more clients with tk_inner implementation once the max number of concurrent clients has been reached
Bug(major)! cli2cpp.py --static bad generation
Bug(major)! " or \ characters in <help/> contents cause compilation errors
Bug(major)! cli2java.py: infinite generation for backward tag[@ref] within tag[@id/@hollow].
Bug(minor)! Crash in CmdLineEdition::GetNextWord()/GetPrevWord() (only used in tests).
Bug(minor)! Left and right parts inversion in CmdLineEdition copy constructor (no impact on the final behaviour).
Bug(minor)! Java: UnsatisfiedLinkError for cli.OutputDevice.__ScreenInfo__getbTrueCls()
Bug(minor)! Rejected! cli2java.xsl: bad generation for backward tag[@ref] within tag[@id/@hollow].
cli2help.xsl, deprecated in CLI 2.9, will remain unfixed. Please use cli2help.py instead.
python scripts addition (more stable and faster): cli2cpp.py, cli2java.py, cli2help.py
XSL stylesheets, schema files and python scripts moved/added in a "tools" directory
(backward compatibility with old XSL and schema paths is still provided)
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)! Rejected! cli2help.xsl: wrong number of options generated for (a|b)+ patterns while (a|b)* works fine.
cli2help.xsl, deprecated in CLI 2.9, will remain unfixed. Please use cli2help.py instead.
Bug(major)! <tag @ref/> preceding <tag @id/> in sub-nodes causes crashes (correction checked with samples/test/fwd-tag.xml sample)
Bug(major)! XSL: '"select" attribute is not allowed on the xsl:call-template element!' XSL transformation error with Saxon (checked also with Xalan) (yuhuawen's contribution integration)
Bug(major)! cli2help.xsl fails with Saxon: various XSL syntax errors fixed
Bug(major)! <string.h> header missing with g++ version 4.4.4 (ubuntu 10.10): NativeObject.cpp, io_mux.cpp, ncurses_console.cpp, tk.cpp
Bug(major)! Misuse of OutputDevice::FreeInstance() return code in Shell::CloseDevices() (major because of possible crashes, never seen however)
Bug(minor)! XSL: return cli::... statements do not compile with Visual Studio 6.0
XSL generation improved for a better readability of the code generated: user-code highlighted, and comments addition indicating the current chain of keywords in analysis
Input/output character management improvements, "endl" support modification for Input/Output devices. '\n' are automatically interpreted by devices now
Input file device improvements: bufferization for optimization, special characters disabling, error location / error prefixing modification
Bug(major)! cli::tk::Queue::Iterator [tk_stl.h] definition revision. Incompatible with some compilers.
Bug(major)! Java object consistency problems.
Bug(major)! XSL generation errors for menus directly generated for an endl node.
Bug(major)! Bad cppclic.xsl generation for 2 level menu structures.
Bug(major)! Memory leak in Queue::~Queue() [tk_inner.h] -> m_arptQueue was not destroyed.
Bug(major)! Consistency errors because of static constant objects in C++ files when compiled with Visual .NET. Singleton used instead.
Bug(major)! Bad javaclic.xsl generation for 2 level menu structures. Test addition.
Bug(major)! History cannot store more than 100 command lines
Bug(minor)! InputFileDevice::GetKey(): unknown characters do not end the file anymore.
Bug(minor)! Spelling error: "Uncomplete" changed to "Incomplete" in CommandLine::Parse().
Bug(minor)! System includes (#include <>) changed into project includes (#include "").
Bug(minor)! When an input file does not exist (cli::InputFileDevice), no error message is printed out.
=> Addition of a m_cliLastError member in cli::OutputDevice, that can be set by all subclasses.
Bug(minor)! TAB when the line is empty does nothing.
Traces consistency improvement. Addition of Traces::UnsetStream()
XSL revisions (inherited from java experience):
CLI tree created in the scope of the CLI class;
Both static and dynamic CLI instantiation;
Generation of CLI_EXECUTION traces
License modification:
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.
Very first release.
I still propose it for download for history purpose only.
Quite stable, but needs little adaptation to work under Windows for instance.
Let's say it was ready for demonstration.
The following chart gives the evolution of the number of code lines throughout the time:
Next evolutions
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 .
May come with next releases:
Other target languages:
Supported languages are C++ and Java at present.
Next ones could be Perl or python...
Enum parameter:
Implement an easier way to let the user enter predefined string values as a parameter, rather than using forward tags.
Memory pools:
Implement memory pools in order to provide better memory management with embedded integration contexts.
...
Download
Latest version of the CLI toolkit is 2.9.
Please refer to history section for previous downloads.