Overview

Sec-Lib has a CLI (Command Line Interface) package that allows you to create character based command line access to pretty much anything you need. One major application is access to a store. There is a driver for the CLI that has Commands (an interface). The contract is that if a command has a specific signature, it will be treated as a command and calls to it at the prompt will be dispatched. In this way, it is really easy to create a fully functional CLI for any project with all the bells and whistles. A supremely useful implementation is accessing a store.

Meta-Commands

These are commands that are prefixed with a / and control how the CLI itself operates.

  • /? - list help for the meta commands
  • /help topic - show help for a topic
  • /h - show the history

Help!

Online Command Help

If you are looking for how to add help to your own system, look at adding help

Every command supports online help. If you are running the CLI then issue

    >command --help

And a great deal of help will be printed. Online help is

Online help for properties etc.

A help facility for properties and such is available. This is accessed with

    /help topic

For instance, each object may have multiple properties and they should be described using this facility.

The Environment

By environment we mean a set of keys and values that may be used as a pre-processor. You set them and access them with ${key} which is replaced by the value. This happens before any other processing of the commands and is a very useful labor saving device. You may set, store, load, etc. these. You do not have to use them, but in many cases where there is a limited functionality of the command line itself (such as no clipboard operations), this can be a very useful tool indeed.

  • clear_env
  • get_env
  • print_env
  • read_env
  • save_env
  • set_env

Serialization of objects.

To serialize an object means to turn it into (in this case) a small XML document. These may be treated like any other document and edited, stored, shared. They may then be imported or deserialized into the store. A common use is to exchange items between stores, or to serialize an object, edit it then restore it.

  • deserialize
  • serialize

CRUD Operations on objects.

  • copy
  • create
  • list_keys
  • ls
  • rename
  • rm
  • update

Working with a single object

You may set an identifier which is then used for all subsequent operations.

  • clear_id -- erase the current default identifier.
  • get_id -- print the current identifier if set.
  • edit -- edit the current object with the identifier
  • set_id -- set the current default identifier

Archiving objects.

Objects may be archived in the store and restored. This is done by making a complete copy of the object and saving it with an overloaded identifier. This is quite useful if you are making changes to an object, but may need to back out of them, or just to have a an audit trail (archive an object before updating it).

  • archive

Searching

  • rs
  • search

Scripting, Batch files

Batch processing, i.e., writing a rudimentary script of commands you would type in and executing it, is supported. For more complex operations, you may need to use something like a bash or QDL script, but a wide variety of cases can be handled.

  • echo -- echo the argument to this command.
  • set_output_on -- toggel output. Of off, then no output of any sort is created.
  • set_verbose_on -- if on, then the system gets a lot chattier about what it is doing.

Miscellaneous Commands.

  • print_help -- print generic help
  • size -- show the size of the store, i.e., the number of entries
  • version --print out the version string for store commands