On 09/21/2015 05:28 AM, Ralph Lange wrote:
What is this for?
Application: a new iocsh command.
iocshLoadDir <pathname> <macros>
Source files inside a directory.
iocshLoadDir creates a list of all files in the specified directory
that are not directories themselves and whose file names
* start with a number,
* do not contain a dot ('. '), and
* do not end with a tilde ('~').
It then sources (via the iocshLoad command) all matching files in
alphabetical order, supplying the specified macro substitutions.
This will allow to get rid of all the ugliness linked to sets of '<
stcmd-snippet' lines with fixed names and orders inside a st.cmd file,
replacing it with a standard mechanism that allows easy non-conflicting
installation of st.cmd snippets by different apps, different system
packages etc.
The actual names, phases and related numbers are completely left to the
users' conventions - base just provides the mechanism.
Interesting idea, can I suggest a different implementation? Would it be
acceptable for the directory parsing to be implemented in a Perl script
that runs at build-time (e.g. in iocBoot/ioc*/Makefile) instead?