* Use C style strings when checking for invalid alias characters
Before, the '\n' would be interpreted as 'n' meaning that any alias
who's command contained the letter 'n' would incorrect be skipped.
* No need to escape characters in this context
Escaping was just adding \ to the list multiple times
Co-authored-by: David Farrell <davidpfarrell+github@gmail.com>
Ensures that the -E or -F option, when used, is the first option
* i.e. grep -oE => grep -E -o
Updates _bash-it-grep to invoke grep with just the provided arguments
* This function was (and still is) unused, but decided this new functionality was actually more useful
Introduces _bash-it-fgrep to invoke grep -F
Removes type -P egrep from the _bash-it-*grep functions
For usages that were already going to be modified, use -F if appropriate
* Does not touch grep usages that may have benefited from -F, but were not otherwise considered for this PR
Adds shellcheck header to modified .bash files that didn't already have it
Convert from indented if-block to return then unindented code. This should have basically one line change at the top, one line removed at the bottom, and then all whitespace.
Apply `shfmt`, but `shellcheck` is an absolute mess, so don't add to `clean_files.txt` yet.
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.
...to `_bash-it()`.
The norm is for the completion function for, e.g., `teh_cmd`. to be named with the same name and a prepended underscore, i.e. `_teh_cmd`. This alsö reduces namespace confusion, which will be relevant in a future patch.
Load the completion script from the subversion package installed on the system, instead of bundling a copy. This addresses Bash-it/bash-it#1818.
NOTE: If `completions/system` is enabled, then it will load this same file anyway automatically.
This reverts commit 2c8ee40566.
- _Shellcheck_ documentation for the [`source-path`]( https://github.com/koalaman/shellcheck/wiki/Directive#source-path ) directive indicates this is correct usage. We're `source`ing the `bash-preexec.sh` file from inside the `vendor/github.com/rcaloras/bash-preexec` directory. If we used the [`source`]( https://github.com/koalaman/shellcheck/wiki/Directive#source ) directive, then the full complete path to the file itself would need to be specified.
- Fix `disable=1090` to `disable=SC1090` and remove duplicate lines since this `shellcheck` directive will apply to the entire if-ladder.
- Disabling `SC2154` is almost never appropriate. In this case, several `_git_bash_completion*` variables are expressly assigned in this file, so there is no "unknown" to ignore.
Aside: the `${!_git_bash_completion@}` construct will expand to all variables starting with the previx `_git_bash_completion`, so this line is just a shorthand way to clear all our variables concisely without forgetting any.