SC2039 - We simply have to use `local` whenever it's possible, and
although it's not defined in POSIX, most common shells do support it
(well, at least Dash, Bash and Zsh).
SC1090 - Sourcing non-constant file is pretty much the main idea of
Shellfu, so avoiding that part does not make sense.
Overview of changes:
* Added workaround to shellfu_api test only against own modules
* Added option to append clarifying message to usage messages
Usage messages can now be made more useful by warning user what
exactly was wrong. Warnings will appear after the usage message
and before command exits and decorated with 'bad usage: ' prefix;
this is so that user will be more likely notice and understand them.
Note that this could be done earlier by using -E option and adding
the warning yourself inside usage() function, but the -w option lets
you keep usage() very simple and yet leads to more consistency.
* Codebase maintenance
* Refactored charmenu.sh
The docstring was not very useful so this it was overhauled
completely. Also more proper coding style is now in place.
* `shellfu` command will now de-duplicate $SHELLFU_PATH
shellfu init function, and by extension some shellfu-doc modes,
would list a module twice if its path ended up twice on
SHELLFU_PATH. That should no longer happen.
* Added mdfmt, a Markdown formatting helper
This module consists of single function with aim to help generate
Markdown text from your scripts.
* Updated and improved usage-related pretty.sh docstrings
* Fixed PRETTY_DEBUG_EXCLUDE double double-underscore bug
PRETTY_DEBUG_EXCLUDE would not work properly on functions like
`foo__bar__baz`, where the second double-underscore would make it
think module name was `foo__bar`, when in fact it's `foo`.
* Added journald logging module for pretty.sh
Using systemd-cat, this module employs journald as way of
communicating with user.
* Added shellfu-sh pseudo-package
On RPM-based distributions, somebody has to own 'include-sh'
directory. Also having shellfu-FOO package helps module packages
declare their "Shellfu flavor" (ie. `Requires: shellfu-sh` sends
clear message that a module is "POSIX-oriented".
* Updated packaging and meta-data
Files responsinle for packaging and versioning meta-data have been
altered to catch up with newer versions of MKit. This should have
almost no effect on package (only 'effect' I can think of is a purely
decorative change in `--version` output).
* Fixed typo in SPEC file
SPEC file claimed that Shellfu is distributed under LGPL2, while
it's actually GPL3. (We should consider changing it to LGPL2,
though.)
* Replaced LICENSE file with Markdown version
Because Markdown is cooler. For a more serious reason, MKit now has
*newstub* script, which can help regenerate MKit structure including
LICENSE file, and this script can only do Markdown (because Markdown
is cooler). TL;DR: It will be less hassle to keep MKit stuff fresh.
* Updated emnedded TFKit (v0.0.14) and MKit (v0.0.21)
Until TFKit is able to run tests in sandbox (instead of running tests
against installed SUT), this test will throw false positives in case
any other Shellfu modules are present.
This commit adds workaround that should be removed when new TFKit
version is installed.
If function name after the module prefix contained double underscore,
the old code would not parse module name properly, e.g.
foo__bar__baz
would consider 'foo__bar' as module name, when only 'foo' should be
considered.
Overview of changes:
* Fixed bug in function doc exporting that caused all function
docstrings be treated as verbatim text in POD
* Fixed case when shellfu-doc was called with non-existent file
* Added --encoding option to shellfu-doc
* Added inigrep test for special chars in section/key/value
* Added validation of section/key names to inigrep
* Build scripts maintenance
The Perl code did not keep hash sign, nullifying effect of the strip_doc
pipe. As a result, the function docstring would contain single space
before each non-empty line.
Markdown does not care about that (well, unless we already had 3 spaces
there in which case a block could be considered verbatim). In POD,
however, this means verbatim plaintext. Viewing as manpage later (by
far most common use case), the visual difference is normally too subtle
to notice, but at some point pod2html had spilled the beans.
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.
Overview of changes:
* Added possibility to set self name for mkusage() explicitly
* pretty/notify now won't spam with one notification per line
* Fixed pretty/html format for die()
* Code maintenance and cleanup
Overview of changes:
* Split tools to shellfu-dependency to get rid of (broken) cyclic
dependency.
Actually shellf-doc and shellfu-embed both make use of pretty.sh, so
we could have either cyclic package dependency or -devel package.
The latter seems more appropriate.
* Updated bash completion
Turns out that since shellfu-doc uses pretty.sh (and makes good use of
it), what we had was broken cyclic dependency.
shellfu-doc and shellfu-embed are useful mostly for developers, though,
so it's no shame to split them.
Overview of changes:
* Improved manpage generation: added --name option to override page
name and re-polished to look a bit more like traditional manpages
* Fixed an outdated test
Try to get closer to how typical manpage looks like:
* Use NAME and DESCRIPTION sections.
* Make structure more flat (FUNCTIONS and VARIABLES on 1st level).
* Use `=item` formatting for function/variable references.
This should be especially useful in scenarios where docstrings are
exported directly from module file, but the filename is not
representative as module name.
This would typically happen where shellfu is only used for documentation
handling but not module handling.