CLISH is a modular framework for implementing a CISCO-like CLI on a Unix system.
Version: 0.7.3CLISH project is a modular framework for implementing a CISCO-like CLI on a Unix system. Arbitrary command menus and actions can be defined using XML files.
License: BSD License
Operating System: Linux
This software handles the user interaction, and forks the appropriate system commands to perform any actions.
Here are some key features of "CLISH":
· Provides CLI tree handling facilities
· Tree built from multiple XML encoded files. (uses tinyxml) This means that XML configuration files can be be made part of 3rd party packages and simply installing them integrates commands into the CLI.
· Access permissions are defined as part of the CLI tree definition; a CLI node/branch may be limited to a specific *NIX group.
· Provides interface to user
· Handles auto-completion of commands
· Only appropriate commands for the current user's "group" will be available.
· Provides parameter type verification facility Each parameter may be of a specific type, which the framework will ensure is correctly entered by the user.
· Provides key-handling for the interface (uses tinyrl) Provides command line editing facilities up/down arrow keys [TAB] command completion [CTRL-A] move to start of command line [?] provides context sensitive help.
· Able to be launched non-interactively
· textual scripts can be written to drive the CLI
· Executes a specified CLI command by launching the appropriate (as defined in the CLI tree) system command line to perform the required action
· Only commands permitted for the current user are available.
· During execution the I/O streams are handed over to the new program.
· Able to spawn a 3rd party shell, where necessary This will take over control of the I/O channel until that sub-shell exits.
· "clish" makes use of multiple XML files to define it's behaviour these...
· Identify scope of the commands (global or specific view(s))
· Include access permissions. By default a command will be accessible to all users, but the schema will provide the ability to limit the command based on UNIX group membership.
· Includes help text for menus
· Includes parameter definitions (with types where appropriate)
· Includes prompt modifications (different views)
· Includes full command line which each leaf node should execute to achieve result.
· Separate set of files for each localization (language) can be provided and determined by the user logging in.
· "packages" can contribute files to define their facilities within the CLI; this makes augmentation of the CLI as simple as including/excluding a particular package.
What's New in This Release:
· Updated shell_execute.c to ensure that directories are not executed
· fixed minor bug in autocompletion of parameters. clish_shell_parameter_generator() needed to account for trailing space when giving context sensitive help for parameters.
· updated lub_heap to maintain the length of blocks inclusive of the block headers and tail. This reduces the overhead of manipulating sizes during operations and also addresses an issue with the re-use of previously freed blocks.
· added dblockpool component for creating dynamic chunks to be used as blockpools. The lub_heap implementation now uses this for holding context instances, which both reduces the overhead memory used and greatly reduces fragmentation when detecting leaks.
· fixed double insert bug in the lub_bintree_insert.c file. Although the function was correctly returning -1 it was also replacing the root node with the provided client node!
· updated shell_tinyrl.c so that typing "?" whilst in the middle of a quoted string inserts the '?' character rather than giving context sensitive help.
· fixed memory leaks which occurred when clish thread is cancelled during execution of a script.
· updated to make the execution of a script asynchronously cancellable.
· modified clish_shell's history command to use new methods
· added tinyrl_history_entry__get_index() method and removed tinyrl_history__get_base()
· modified tinyrl_history so that index is held in the history_entry instances Then updated the history insertion code so that duplicate entries are only held once in the history. This means that numeric gaps can now occur in the history list, but a stifled list will no longer force recent commands off the list through the repetition of a single command.
· updated tinyrl_completion() so that if the completion list contains words which have a common (case insensitive) prefix are correctly handled. Before this fix if commands "one" and "OneTwoThree" both existed in the same view then the user would be unable to type anything beyond "one".
· fixed bug in clish_shell_tinyrl_key_enter() where a pointer to the line for the current tinyrl instance was being held onto after it had been changed by an auto-completion, hence was now referencing freed memory.
· ensure that when reading a script and an error occurs we don't bother to show the errored command line after the "DING"
· ensure that after reading a script the prompt isn't duplicated.
· fixed memory leak in clish_pargv_init() where the 'args' parameter wasn't releasing its working string.
· fixed tinyrl_redisplay so that CTRL-K works; wasn't accounting for insertion point movements before erasing characters from end of line.
· fixed history.c so that stifled history lists add_n_replace() properly. This also addresses an assertion which was occuring with "history 1"
· updated clish_shell class so that when an error occurs in a script, execution is terminated in any parent scripts. This doesn't terminate an interactive session. This means that a script will now only run until it's first error (or the first error of a child script etc...)
· plugged a poential memory leak in lub_string_catn() function.
· fixed clish_shell_delete() so that the file stack is cleared out.
· updated lub/argv class to be more resilient when memory allocation failures occur.
· reduced the terminal noise generated by tinyrl when auto-completion occurs.
· reduced the termnal noise generated by tinyrl when user deletes characters from the end of a line.
· VxWorks has an issue with its pthreads library which means that a cleanup hook can be called multiple times (recursively)!!!. Updated the cleanup function to set the pthread cancel state to PTHREAD_CANCEL_DISABLE to prevent this.
· found and fixed a memory leak in the stack of files being used for input.
· updated auto-completion code to handle quoted arguments.
· fixed echoing issue when echoing should be hidden.
· overhauled the auto-completion code. Now capable of autocompleting parameters as well as commands. Parameters are now validated as they are typed. This has involved some restructuring of the tinyrl_completion interfaces.
· fixed so that validation of integers works correctly.
· removing the spurious auto-completions has had the side effect of not echoing commands executed from scripts. fixed this issue.
· modified the help system so that if a command has possible other commands which are an extension of the current command name (e.g. slot, slotOne, slotTwo) then the command help will be augmented the summary help of the possile completion commands.
· fixed bug where the SPACE key could cause spurious completion information to be displayed before entering a space character.
· fixed clish_shell_help.c so that any detailed help held for "place-holder" commands (e.g. "show slot" has a place holder command called "show") will be displayed when ?? is entered.
· fixed bug where entering a command which happened to be a prefix of other commands, caused spurious completion information to be displayed before executing the command.
· cleaned up the tinyrl.c to remove a spurious tinyrl_crlf() call when reading a line. If a command outputs no text to stdout/stderr then the prompt will now reappear on the following line rather than leave a blank.
· Updated the context sensitive help so that any parmeters which have specific ranges e.g. "integer" or "selection" indicate these possible values in the help text.
· Updated the ptype class to allow for pre-processing of parameter before validation. See the XML schema for details.
· Updated the ptype class to allow three methods for parameter validation. "regexp"[default], "integer" and "select" See the XML schema for details.
· Went through the code cleaning up PC Lint issues.
· Added a last_buffer field to the tinyrl class to cache the last displayed line. This can then be used to reduce the number of output characters when only a single char has been added to the end. This simplifies the automated testing/interaction with the CLI. e.g. expect scripts.
· updated tinyrl.c to cache the isatty settings. This provides a new operation called tinyrl__get_isatty()
· removed nested shell support for a single client. It is no longer needed as the "clish_source" command is used instead of spawning another shell.
· changed so that history entries are only added for interactive lines. So if for example a user were to "clish_source" another file, the commands so issued from that file will not be added to the history.
· changed "clish_spawn" back to "clish_source" and implemented a stack of file handles per shell instance. The spawning of a sub-script was resource intensive, and had issues with spawned pthreads not having the attributes (e.g. stack size) as the parent thread. It also felt too clunky to have multiple shell associated with a single client.
· fixed tinyrl_readline() to make sure that lines longer than 80 chars are handled correctly when read from a script.
· modified tinyrl_replace_line() to only modify the insertion point if the buffer shrinks beyond the current insertion point. This addresses the inserting spaces in the middle of a line issue.
· fixed clish_shell_spawn_from_file() so that it returns BOOL_TRUE upon success.
· fixed tclish executable to read input from files correctly.
· updated tinyrl.c to simply read non-tty input streams rather than try and treat them like an interactive session.
· fixed tclish executable to account for nested shells being attached to a single client. (using the "clish_spawn" builtin command.). Only when the root shell is initialised or finalised will the resources be allocated and freed.
· renamed the "clish_source" builtin command to "clish_spawn"; it takes a filename and spawns a new shell to interpret the contents of the file.
· added tinyrl__get_istream() tinyrl__get_ostream(), tinyrl_vt100__get_istream() and tinyrl_vt100__get_ostream() operations. This means that a client of CLISH can identify which file handles are being used. This is useful in the case of a client which is sourcing files using the "clish_source" builtin command.
Fixed to ensure that SPACE auto-completion works with commands which take "args" type parameters.
What's New in This Release:
· minor bug fix from Cliff Martin which avoids a SEGV when CTRL-C is invoked on an empty line.