You can't "get function" or "get module" with these functions; just
their *names*. Also "get" is inconsistent with eg. sfpi__ls() and
sfpi__key(): the "getting" part is implied.
Use colon to separate module and object in listing
Make the list a bit easier to handle in scripts (colon does not have
special regex meaning).
Also im human-readable contexts, dot makes it more likely to confuse the
string with with filename (eg. `foo.bar`.) But then again, it's better
for humans to go a bit further and decorate the reference, eg.
`foo:bar()` or `foo:$BAZ`. (Doing that in default output would make
them hard to parse, though.)
Due to Bash limitations and performance concerns, few characters are
not usable in section/key names in this version of inigrep.
This commit adds validation to catch these cases and warn user instead
of silently providing invalid output.
Note that there is one case which we can't catch, and that is dot in a
key name. However, this is rather question of key paths: dot is used as
a delimiter in key paths, so allowing it in key name would lead to
ambiguous keypath syntax.
Main changes:
* Removed ability to guess, search and merge files.
Old inigrep was doing too much. Instead of just being "grep for
INIs", it tried to guess file arguments, look for data in local
folders and smartly merge files based on locality, effectively
becoming sort of a configuration registry tool. While that function
can be (and was) highly useful, it is vastly outside inigrep's main
purpose; coupling like this made inigrep much harder to understand.
At the same time, only saturnin applications really used this;
so it became obvious where such behavior belongs, so relevant
code was moved to saturnin__conf, which now acts as wrapper around
the new inigrep.
* Rewrote API.
Old API was designed around the original idea, long long time ago,
when use cases were not clear yet. This fact propagates as the old
API being a bit gimmicky, too "granular" with little usability gain
but great graspability loss.
New API, on the other hand, simplifies section/key syntax and
concentrates on few simple modes, easy to understand and/or ignore.
* Added module-level documentation.
Now that shellfu-doc can work as manpage reader, it would be shame
to not include at least some basic documentation inside modules.
inigrep (albeit being one-function module) is proud to be the first
one in shellfu core module set to have at least simple introduction.
Most changes are in tf_do_subtest.
* Separated setup/cleanup logic from test data collecting and
execution/evaluation.
* Revamped the execution/evaluation logic in a new tool testflt,
allowing tester to use it as the need be.
* Code to compose actual test command removed, as testflt makes it
easy to write the code in one place (TF_RUN) and keep simple things
simple.
* Removed tf_parse_meta, as it's obsolered by above changes.
* Updated tests to reflect the new style.
This new hierarchy makes it easier to work simultaneously on data and
the script, simplifies deployment to tempdir and makes the launching
script naming consistent with simple.sh.
Now testname.oracle file can specify expected exit status file
as well, or different path for stdout/stderr oracles (default is
testname.oracle.stdout and testname.oracle.stderr)
This effectively allows for testing scenarios where exit status or error
output can be tested as well.
config.cfgrep does better job at hinting how the function works
(i.e. somehow similar to UNIX grep) and that the use is not limited to
INI files.
Also default config file suffix is now "conf".