No need for AWK there. By using just `read` (builtin), instead of
AWK, this commit winds up being a considerable optimization.
NOTE: The `_` is just commonly used to indicate junk; not used.
Much like my previous commit, grep(1) isn't needed here at all. BASH
can handle REGEX as well as glob pattern matching in a very similar
way.
In this commit, I've made use of a `while read` loop to achieve the
same thing as before, but much more efficiently. If it turns out that
the `rbenv` command usually returns a crap ton of data (10s of
thousands of lines, at _least_), then please ignore this commit.
Most of the time, people use programs like tr(1) and wc(1) when they're
woefully unnecessary, serving only to make their programs inefficient
and bloated. BASH itself can deal with most of these tasks with
absolute ease. This is one such situation.
In:
```bash
if [[ -n "$(_git-status | tail -n1)" ]]; then
```
It seems pointless using tail(1); it does nothing here, unless I'm
missing something. Also, quotes aren't needed, because word-splitting
doesn't apply when variables are expanded in `[[`.
```bash
if [[ -n $(_git-status) ]]; then
```
The quoting thing is all over the code, but not a huge deal, as it's
just superficial. Variable word-splitting doesn't apply also during
the WORD in the case statement, and the VALUE in shell variable
assignment.
Personally, I would use `[`, since none of the `[[` features are being
used here, so it seems wasteful. In the BASH (4.4) source code,
assuming I'm looking at it correctly, `[[` is over 800 lines, yet `[`
(or `test`) is not even 200; that's part of the reason I prefer `[` and
use `[[` when it's actually needed. It's also not a huge deal though, -
as this is going to be incredibly fast either way, but thought I'd
mention it.
This sort of test:
```sh
if CONDITION; then
if CONDITION; then
LIST
fi
fi
```
The above is typically unnecessary, as the two conditions can be
combined to avoid pointless nesting.
Regarding the optimization: it's very minor, but there was an
unnecessary use of a subshell (command substitution) in testing this:
```
git rev-parse --is-inside-work-tree
```
This has been addressed, and instead of STDERR going to '/dev/null', -
now both STDOUT and STDERR do.
Although I'm pointing out this in just one instance, this sort of stuff
appears to be all over the code in this project, unfortunately.
Added a vendored lib loading routine in bash-it.sh
Added documentation on how to vendor libs in bash-it
Added and fixed plugins using preexec
Added tests for two plugins
Removed the old preexec lib
[Toolbox](https://github.com/containers/toolbox) is an containerized
development environment. This commit adds a promot to powerline when it
is running inside a toolbox.