SLA's home page is http://sla.sourceforge.net.
The SourceForge project page for SLA is http://sourceforge.net/projects/sla/.
What is it? | Background | General Approach | Documentation | Getting SLA | Copyright | FAQ
SLA is a run-time library of functions to carry out variable assignment instructions such as those specified by command line arguments and configuration files. It looks for user-specified assignment instruction syntax and carries out instruction found. It is available in C, C++, Perl and Bourne shell versions. SLA is compact, flexible and easy to use.
You might think of SLA as yet another command-line option parser, but it differs in several important ways. Notably, it supports regular expressions in identifying the assignment instructions; it can use conversion functions for assigning to user-defined types; and it is meant to be used as self-contained function calls.
SLA is not a code-generator, does not use global variables, and you don't have to prebuild data before calling the function. It does not internally generate help messages. It does not automatically generate abreviations to options. (You can explicitly do this using regular expressions though). It permits but does not automatically facilitate and enforce the POSIX guidelines for command-line options of a program. This is so because SLA is written for broader uses.
I initially wrote this to clean up codes that process command line arguments. At the time, I found a couple of free packages offered for this, but none were library functions and none could handle anything but the simplest instructions. I wanted a design that can provide similar interfaces across programming languages and works with regular expressions and user-defined C/C++ types. And I wanted more flexibility in how to use the results of the search for matching commands.
SLA has been used extensively on Intel/Linux, Sun/Solaris, Dec/OSF, DEC/Linux and SGI/IRIX computers, on one thesis, several software projects and a number of utility scripts.
SLA views assignment instructions as having four components: flag indicator, parameter name, assignment operator and value. The first three components can be regular expressions, allowing the assignment instruction to take on many forms. For example, the assignment instructions below in the first columns can be composed of (or more precisely, matched by) components in the four remaining colums:
The self-contained function calls to find and implement the above assignment instruction for the first example will look something like
'windows is broken'
' +(is|are) +'
in C++ andsla::scan( &argc, argv, "--", "=", "pi", &pi ); in Perl.eval &sla_scan( \@ARGV, '--', '=', 'pi' );
The SLA syntax is flexible and can be molded to parse stricter standards, such as the POSIX option parsing standard. The SLA library has functions for parsing string lists conforming to the POSIX standard.
SLA comes with SGML documentation. The html, text, PostScript and sgml forms are included in the distribution and also in the documentation directory.
SLA source and RPMs can be downloaded from the SLA project's download page.
SLA is copyright Brian T.N. Gunney and distributed under the GNU Lesser General Public Licence (LGPL). More information on the GNU public licences is available at the Free Software Foundation web page.
There isn't a FAQ right now. But if I get enough questions, I'll compile one.