Commit Graph

3791 Commits

Author SHA1 Message Date
Noah Gorny
9d6fe72267 Merge pull request #2088 from gaelicWizard/lib/log
lib/log: //echo/printf
2022-02-16 22:18:22 +02:00
Noah Gorny
0b1c65b100 Merge pull request #2092 from punchagan/link-profile
lib/helpers: Don't rm "$profile_path" before writing to it
2022-02-16 22:14:28 +02:00
Noah Gorny
b550b99160 Merge pull request #2091 from gaelicWizard/completion/alias
completion/aliases: redirection, quote, temp file
2022-02-16 22:12:57 +02:00
Puneeth Chaganti
b3ef9ea209 lib/helpers: Don't rm "$profile_path" before writing to it
When the file is being re-created, we write to it, instead of appending to
it. So, the rm here is unnecessary and prevents users from linking the profile
file to another location that is potentially under version control. For
instance, once could link to a profile file located at
"$BASH_IT_CUSTOM/profiles/*.bash_it".
2022-02-16 20:55:08 +05:30
John D Pell
e7b91e7be5 lib/log: use newly supported composure.sh feature
- these functions can now run even if `composure.sh` has *not* been loaded at all!
2022-02-15 22:20:19 -08:00
John D Pell
61b6393a4a lib/log: //echo/printf
- Replace `echo -e` with `printf` in `_bash-it-log-message()`.
- Local positional parameters to allow for defaults.
- Use `if`/`then` properly.
- Clean up use of `$BASH_IT_LOG_PREFIX` slightly (eliminate duplicate colons).
2022-02-15 22:18:24 -08:00
John D Pell
4ba11dbaa2 completion/aliases: redirection, quote
Alsö, some aliases are returned by `alias -p` with `alias -- xxxxx`...which confuses the function, so handle it specially.
2022-02-15 22:09:27 -08:00
Noah Gorny
562eb6ce68 Merge pull request #2083 from tbhaxor/patch-1
Remove redundant aliases for clear screen
2022-02-15 22:47:42 +02:00
Noah Gorny
78da4ca760 Merge pull request #2089 from gaelicWizard/plugin/alias-completion
completion/aliases: typo
2022-02-15 22:09:44 +02:00
John D Pell
c982a881a2 completion/aliases: typo 2022-02-14 16:00:15 -08:00
Noah Gorny
0619c19f65 Merge pull request #2074 from NariyasuHeseri/master
plugin/battery: bug fix
2022-02-14 08:22:33 +02:00
Noah Gorny
561e282585 Merge pull request #2044 from gaelicWizard/completion/alias
completion/aliases: eliminate use of `eval`
2022-02-13 23:59:35 +02:00
Noah Gorny
89c9504a5e Merge pull request #2017 from gaelicWizard/lib/preview
lib/preview: functionalize
2022-02-13 23:59:06 +02:00
Noah Gorny
ee135d28da Merge pull request #2069 from gaelicWizard/completion/system
completion/system: correctly load version when not linked
2022-02-13 23:57:35 +02:00
Noah Gorny
253004a599 Merge pull request #1940 from gaelicWizard/history
Feature: automatic history management
2022-02-13 23:57:14 +02:00
Noah Gorny
23f9b7416a Merge pull request #1902 from gaelicWizard/glob
Glob for *.bash properly when path contains spaces
2022-02-13 23:53:57 +02:00
John D Pell
146107926e main: variable name cleanup 2022-02-10 10:46:33 -08:00
John D Pell
5d5858058e lib/history: new functions _bash-it-history-auto-*()
Two new functions `_bash-it-history-auto-save()` and `_bash-it-history-auto-load()`, which append new history to disk and load new history from disk, respectively.

See bash-it/bash-it#1595 for discussion.
2022-02-08 16:59:29 -08:00
John D Pell
f6119567e8 plugin/history*search: no need to load after plugin/history
There's no need for these plugins to load after `plugin/history`. None of the history plugins depend upon each other loading before, after, or at all.
2022-02-08 16:59:29 -08:00
John D Pell
267a721ac6 plugin/history-eternal: Use readonly instead of export
...and hide errors relating to setting already-readonly variables.

`plugin/history-eternal` does not need to force loading after `plugin/history` because both plugins will play nicely with read-only variables, and since we're overwritting and marking read-only then the intended result survives no matter which loads first.

plugin/history-eternal: require Bash v4.3+

Unlimited history is only possible in _Bash_ version 4.3 and up
2022-02-08 16:59:29 -08:00
John D Pell
8052911861 plugin/history: don't use export
...so the plugin is friendly to variables already marked read-only.
2022-02-08 16:59:29 -08:00
Gurkirat Singh
70dbda053b Remove redundant aliases for clear screen 2022-02-08 14:49:43 +05:30
John D Pell
00e3955dd3 lib/preview: add full completion 2022-02-07 15:27:03 -08:00
John D Pell
a9a40a3cad lib/helpers: add preview to bash-it spaghetti 2022-02-07 15:27:03 -08:00
John D Pell
d6555f369a lib/preview: refactor into a function
This allows future use like `bash-it preview`. Alsö, allows to use `$BASH_PREVIEW` to specify a particular theme to preview instead of just doing all of them.
2022-02-07 15:27:03 -08:00
John D Pell
1480cdfa34 completion/system: correctly load version when not linked
- Load the correct version of `bash-completion` even when not "linked".
2022-02-07 15:15:46 -08:00
John D Pell
bc95eceb10 main: adopt _bash-it-log-prefix-by-path() 2022-02-06 16:59:03 -08:00
John D Pell
0d346b204f main: Glob for *.bash properly when path contains spaces
- `shfmt`, `shellcheck`
- Clean up legacy/compatibility code to simpler control flow
- Move theme stuff down to where themes are handled
- Don't use `**` as _Bash It_ has never before set `globstar`; this eliminates varying behavior by environment; this alsö fixes users having any not-enabled themes under their custom dir.
- Lose weird Mac-specific alternate shell startup file (Bash loads startup files on Mac the same as it does on any other *nix system.)
- Place `composure.sh` init all in one place
- remove 10-years-deprecated backwards compatibility: Deprecated in `b59ee658f78ec6ff8c6c2754216e0322b7fe18e2` dated 2011-10-29.
2022-02-06 16:59:03 -08:00
Noah Gorny
4dbe92e38d Merge pull request #2075 from NariyasuHeseri/awk_unterminated_regexp
helpers: fix `awk: unterminated regexp`
2022-02-04 11:52:21 +02:00
John D Pell
43df0fe130 completion/aliases: rename init function
Use the callback naming convention for the init function, for later use.
2022-02-03 22:49:39 -08:00
John D Pell
302bae9c5f test/battery: require matching battery identifier 2022-02-03 16:47:17 -08:00
John D Pell
23f7916a4d test/battery: add multiple-battery edge case 2022-02-03 10:45:27 -08:00
John D Pell
cade0a1e7a plugin/battery: split upower to two variables 2022-02-03 10:45:27 -08:00
Nariyasu Heseri
1e77c26c00 helpers: fix awk: unterminated regexp 2022-01-31 23:54:14 +09:00
John D Pell
880488ec9a completion/alias: add stub file
- put a loader to remove the symlink at `enabled/***---alias-completion.plugin.bash`.
2022-01-30 16:13:54 -08:00
John D Pell
b0862899d7 completion/alias: fix tests 2022-01-30 16:13:54 -08:00
John D Pell
7fcad6ed0d completion/alias: rename
There is no reason for this to be in the `plugins` directory, it just needs to have a load priority sufficiently high that it runs after any aliases are defined.
2022-01-30 16:13:54 -08:00
John D Pell
d214621d39 completion/alias: shfmt && shellcheck 2022-01-30 16:13:54 -08:00
John D Pell
b0f23d8e98 completion/alias: eliminate use of eval 2022-01-30 16:13:54 -08:00
Noah Gorny
578c702ca3 Merge pull request #2055 from gaelicWizard/lib/reloader
lib/reloader: lint and modernize
2022-01-30 00:10:32 +02:00
Noah Gorny
2a9ee7e344 Merge pull request #2019 from gaelicWizard/lib/colors
lib/colors: split out metaprogramming
2022-01-30 00:10:14 +02:00
Noah Gorny
39e5652ee5 Merge pull request #1932 from gaelicWizard/search
Lib/search: lint, cleanup, and small fixes
2022-01-30 00:09:49 +02:00
Noah Gorny
1d6f4d747b Merge pull request #2067 from gaelicWizard/BASH_IT_BASHRC
lib/helpers: eliminate assumptions about login shells
2022-01-29 22:42:21 +02:00
Nariyasu Heseri
c794f4f0e7 plugin/battery: use --max-count of grep instead of head 2022-01-29 15:50:36 +09:00
John D Pell
26b402e254 lib/reloader: unset "${!_bash_it_reloader_@}" 2022-01-28 13:58:00 -08:00
John D Pell
4cf2aae36e lib/search: code cleanup
Improve `_bash-it-erase-term()`, `_bash-it-flash-term()`, `_bash-it-rewind()`, `_bash-it-search-result()`, and `_bash-it-search-component()`. Minor tweaks to `_bash-it-is-partial-match()`, and `_bash-it-search()`.
2022-01-28 13:35:17 -08:00
John D Pell
b8694ee140 lib/search: shfmt
My apologies to future `git blame` hunters ♥
2022-01-28 13:35:17 -08:00
John D Pell
8939e943c5 lib/search: fix usage statement _bash-it-search()
SC2154
2022-01-28 13:35:17 -08:00
John D Pell
64efe52394 lib/search: fix _bash-it-flash-term()
1. `$text_black` isn't a parameter provided by _Bash It_. Typo?
2. `$bold_yellow` is meant for prompt strings and putputs `\[`; ditto `$bold_red`.
3. The color was never returned to normal after.
2022-01-28 13:35:17 -08:00
John D Pell
afeb4d6e11 lib/search: shellcheck
SC2076
SC2091
SC2004
SC2086
SC2207
2022-01-28 13:35:17 -08:00