Now that color definition utilities (_lp_ti_*) variables and functions
are "local" we do not fear to override someting defined by the user.
So just rename to shorter and cleaner names without the _lp_ prefix.
Move colors definitions inside _lp_source_config.
(The important part of the diff is that the beginning of the
_lp_source_config function is moving up).
Now use TermInfo feature detection instead of just distinguishing if
"$OS == FreeBSD". This will allow support for more terminal definitions.
Cleanup color variables (BLACK, WHITE, BLUE, BOLD...) once the config
file has been loaded as color variables are not used at runtime.
In eec94d1db8d2a87b10c1034429f44c00bffc1be8 (which is about the time
feature) it looks like 7f2ed35c414cbb5b34ea50ac8867fa58311ff4fb has
been reverted (probably a merge error). This patch reapplies it.
For git/svn/hg, the tool presence in $PATH is detected just once at init
time (instead of at runtime, at every prompt display) and the LP_ENABLE_
variable is set to false if it is missing.
For boolean variables (there is no such type in shell) we consider
that '1' is true, and everything else ('0', ''...) is false.
So all tests are now done by comparing the "one true value", '1', and
variables expansion is protected with quotes.
Affects LP_ENABLE_*, LP_HOSTNAME_ALWAYS.
Yes, much more config options, but it allows to lighten the prompt and
so improve its speed. I wanted to detect the useful parts by parsing the
theme but it seems impossible (I didn't find how).
This add colors to features in the main code, so as to avoid having to specify
them in the template part. LP_PS1 is thus easier to set, with just a list of
features to activate along with basic characters.
On Linux, hide the "command not found" message on Linux when 'nproc'
is missing and the grep fallback is used.
(nproc doesn't exist on Debian Lenny, see issue #31 and #36)