From c5643d4230fe8bdf0097c9cda23aa876304beb47 Mon Sep 17 00:00:00 2001 From: Ari Archer Date: Sun, 16 Oct 2022 17:41:29 +0300 Subject: [PATCH] 2.4.0: Bug fixes, more plugins, documentation - Fix a bug where it'd load preload.env even though it doesn't exist [major] - Add more plugins to the list - Add docs on how to uninstall baz Signed-off-by: Ari Archer --- .clang-format | 19 +++++++++++++++++++ .editorconfig | 11 +++++++++++ PLUGINS.md | 31 ++++++++++++++++--------------- README.md | 42 +++++++++++++++++++++++++----------------- baz | 4 ++-- 5 files changed, 73 insertions(+), 34 deletions(-) create mode 100644 .clang-format create mode 100644 .editorconfig diff --git a/.clang-format b/.clang-format new file mode 100644 index 0000000..1f4f375 --- /dev/null +++ b/.clang-format @@ -0,0 +1,19 @@ +--- +BasedOnStyle: LLVM +IndentWidth: 4 +SortIncludes: false +AlignConsecutiveAssignments: true +AlignConsecutiveBitFields: true +AlignConsecutiveMacros: true +AlignEscapedNewlines: true +AllowShortCaseLabelsOnASingleLine: true +AllowShortEnumsOnASingleLine: true +AllowShortFunctionsOnASingleLine: true +AllowShortLambdasOnASingleLine: true +BinPackParameters: false +IndentCaseBlocks: true +IndentCaseLabels: true +IndentExternBlock: true +IndentGotoLabels: true +--- + diff --git a/.editorconfig b/.editorconfig new file mode 100644 index 0000000..6c54233 --- /dev/null +++ b/.editorconfig @@ -0,0 +1,11 @@ +root = true + +[*] +end_of_line = lf +insert_final_newline = true +indent_style = space +indent_size = 4 +charset = utf-8 +trim_trailing_whitespace = true +tab_width = 2 + diff --git a/PLUGINS.md b/PLUGINS.md index dc1d547..8e5efcb 100644 --- a/PLUGINS.md +++ b/PLUGINS.md @@ -1,17 +1,18 @@ # Some baz plugins :) -- [Example plugin by @TruncatedDinosour](https://github.com/TruncatedDinosour/baz-example-plugin) [Name:example License:WTFPL] -- [Shortcmd plugin by @TruncatedDinosour](https://github.com/TruncatedDinosour/shortcmd-baz-plugin) [Name:shortcmd-baz-plugin License:WTFPL] -- [Coffee theme plugin by @coffee-theme](https://github.com/coffee-theme/coffee.baz-plugin) [Name:coffee.baz-plugin License:WTFPL] -- [Coloured man pages plugin by @TruncatedDinosour](https://github.com/TruncatedDinosour/coloured-man-pages-plugin) [Name:coloured-man-pages-plugin License:WTFPL] -- [Better bash plugin by @TruncatedDinosour](https://github.com/TruncatedDinosour/better-bash-baz-plugin) [Name:better-bash-baz-plugin License:WTFPL] -- [Ls aliases by @TruncatedDinosour](https://github.com/TruncatedDinosour/ls-aliases-baz-plugin) [Name:ls-aliases-baz-plugin License:WTFPL] -- [Vifzf bindings by @TruncatedDinosour](https://github.com/TruncatedDinosour/vifzf-keybinds-baz-plugin) [Name:vifzf-keybinds-baz-plugin License:WTFPL] -- [Coffee TTY theme plugin by @coffee-theme](https://github.com/coffee-theme/coffee.tty-theme) [Name:coffee.tty-theme License:WTFPL] -- [Venvin virtualenv helper plugin by @TruncatedDinosour](https://github.com/TruncatedDinosour/venvin-baz-plugin) [Name:venvin-baz-plugin License:WTFPL] -- [Trash CLI aliases plugin by @TruncatedDinosour](https://github.com/TruncatedDinosour/trash-cli-rm-baz) [Name:trash-cli-rm-baz License:WTFPL] -- [YT-dlp aliases plugin by @TruncatedDinosour](https://github.com/TruncatedDinosour/yt-dlp-aliases-baz-plugin) [Name:yt-dlp-aliases-baz-plugin License:WTFPL] -- [Bettercmd plugin by @TruncatedDinosour](https://github.com/TruncatedDinosour/bettercmd-baz-plugin) [Name:bettercmd-baz-plugin License:WTFPL] -- [Cmdutils plugin by @TruncatedDinosour](https://github.com/TruncatedDinosour/cmdutils-baz-plugin) [Name:cmdutils-baz-plugin License:WTFPL] -- [Agnoster theme by @TruncatedDinosour](https://github.com/TruncatedDinosour/agnoster-theme-baz-plugin) [Name:agnoster-theme-baz-plugin License:MIT,MIT] -- [Git aliases by @TruncatedDinosour](https://github.com/TruncatedDinosour/git-aliases-plugin) [Name:git-aliases-plugin License:WTFPL] +- [Example plugin by @TruncatedDinosour](https://github.com/TruncatedDinosour/baz-example-plugin) [Name:example License:WTFPL] +- [Shortcmd plugin by @TruncatedDinosour](https://github.com/TruncatedDinosour/shortcmd-baz-plugin) [Name:shortcmd-baz-plugin License:WTFPL] +- [Coffee theme plugin by @coffee-theme](https://github.com/coffee-theme/coffee.baz-plugin) [Name:coffee.baz-plugin License:WTFPL] +- [Coloured man pages plugin by @TruncatedDinosour](https://github.com/TruncatedDinosour/coloured-man-pages-plugin) [Name:coloured-man-pages-plugin License:WTFPL] +- [Better bash plugin by @TruncatedDinosour](https://github.com/TruncatedDinosour/better-bash-baz-plugin) [Name:better-bash-baz-plugin License:WTFPL] +- [Ls aliases by @TruncatedDinosour](https://github.com/TruncatedDinosour/ls-aliases-baz-plugin) [Name:ls-aliases-baz-plugin License:WTFPL] +- [Vifzf bindings by @TruncatedDinosour](https://github.com/TruncatedDinosour/vifzf-keybinds-baz-plugin) [Name:vifzf-keybinds-baz-plugin License:WTFPL] +- [Coffee TTY theme plugin by @coffee-theme](https://github.com/coffee-theme/coffee.tty-theme) [Name:coffee.tty-theme License:WTFPL] +- [Venvin virtualenv helper plugin by @TruncatedDinosour](https://github.com/TruncatedDinosour/venvin-baz-plugin) [Name:venvin-baz-plugin License:WTFPL] +- [Trash CLI aliases plugin by @TruncatedDinosour](https://github.com/TruncatedDinosour/trash-cli-rm-baz) [Name:trash-cli-rm-baz License:WTFPL] +- [YT-dlp aliases plugin by @TruncatedDinosour](https://github.com/TruncatedDinosour/yt-dlp-aliases-baz-plugin) [Name:yt-dlp-aliases-baz-plugin License:WTFPL] +- [Bettercmd plugin by @TruncatedDinosour](https://github.com/TruncatedDinosour/bettercmd-baz-plugin) [Name:bettercmd-baz-plugin License:WTFPL] +- [Cmdutils plugin by @TruncatedDinosour](https://github.com/TruncatedDinosour/cmdutils-baz-plugin) [Name:cmdutils-baz-plugin License:WTFPL] +- [Agnoster theme by @TruncatedDinosour](https://github.com/TruncatedDinosour/agnoster-theme-baz-plugin) [Name:agnoster-theme-baz-plugin License:MIT,MIT] +- [Git aliases by @TruncatedDinosour](https://github.com/TruncatedDinosour/git-aliases-plugin) [Name:git-aliases-plugin License:WTFPL] +- [Mpvp-report plugin by @TruncatedDinosour](https://github.com/TruncatedDinosour/mpvp-report) [Name:mpvp-report License:gpl3] diff --git a/README.md b/README.md index 4c9675d..5ea2adc 100644 --- a/README.md +++ b/README.md @@ -4,16 +4,16 @@ # Credits -- [@DannyBen](https://github.com/DannyBen) -- For creating an awesome tool for completion: https://github.com/DannyBen/completely +- [@DannyBen](https://github.com/DannyBen) -- For creating an awesome tool for completion: https://github.com/DannyBen/completely # Dependencies -- GNU coreutils -- GNU bash -- Git cli -- Linux -- Rlwrap (optional, but it's nice for special keys) -- Bash-completion (optional, but it's nice for well.. Completion) +- GNU coreutils +- GNU bash +- Git cli +- Linux +- Rlwrap (optional, but it's nice for special keys) +- Bash-completion (optional, but it's nice for well.. Completion) # Automatic setup @@ -28,8 +28,8 @@ $ bash baz_setup.sh Configuration: -- `__BASH_RUNAS`: The `sudo` program (sudo) -- `PREFIX`: Where to install baz (/usr/bin) +- `__BASH_RUNAS`: The `sudo` program (sudo) +- `PREFIX`: Where to install baz (/usr/bin) # Plugin indexing @@ -45,8 +45,8 @@ $ git clone https://github.com/TruncatedDinosour/baz 1. Install the script anywhere, or even run it standalone -- Running standalone means just running it -- Installing could be done in for example `/usr/local/bin`: +- Running standalone means just running it +- Installing could be done in for example `/usr/local/bin`: ```bash $ su -c 'install -Dm755 baz /usr/local/bin' @@ -81,6 +81,14 @@ This is the main loader for plugins $ ./scripts/comp.sh ``` +# Uninstallation + +Uninstall the `baz` 'binary' and then just run: + +``` +$ rm -rf ~/.local/share/baz +``` + # Help page ```bash @@ -105,15 +113,15 @@ $ ./scripts/comp.sh # Other docs -- [Doc folder](/doc) +- [Doc folder](/doc) # Examples -- [Examples folder](/examples) -- [My example plugin repo](https://github.com/TruncatedDinosour/baz-example-plugin) +- [Examples folder](/examples) +- [My example plugin repo](https://github.com/TruncatedDinosour/baz-example-plugin) # Debugging -- Set `BAZ_DEBUG` to any value to any value to debug the `baz` cli with tracing -- Set `BAZ_DEBUG_LOAD` to any value to debug the loader -- Add `set -x` before and `set +x` after the loader to enable tracing +- Set `BAZ_DEBUG` to any value to any value to debug the `baz` cli with tracing +- Set `BAZ_DEBUG_LOAD` to any value to debug the loader +- Add `set -x` before and `set +x` after the loader to enable tracing diff --git a/baz b/baz index dc235dc..08f0a8e 100755 --- a/baz +++ b/baz @@ -2,7 +2,7 @@ [ "$BAZ_DEBUG" ] && set -x -export BAZ_VERSION='2.3.1' +export BAZ_VERSION='2.4.0' export BAZ_DIR="$HOME/.local/share/baz" export BAZ_CONFDIR="$HOME/.config/baz" export BAZ_CONF="$BAZ_CONFDIR/config.env" @@ -715,7 +715,7 @@ baz_enable() { main() { use printf return - [ "$_BAZ_NO_PRE" != true ] && . "$BAZ_PRE" + [ "$_BAZ_NO_PRE" != true ] && [ -f "$BAZ_PRE" ] && . "$BAZ_PRE" if [ "$BAZ_NORLWRAP" != true ] && command -v rlwrap >/dev/null; then use mktemp trap rlwrap return