Commit Graph

436 Commits (c88a4bfa8900541adb23f8e88fd9e3a80f624cae)

Author SHA1 Message Date
convergedtarkus c88a4bfa89 No need to escape characters in this context
Escaping was just adding \ to the list multiple times
2023-01-23 11:07:00 -06:00
convergedtarkus 4fc9869012 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.
2023-01-11 15:26:24 -06:00
David Farrell 00062bfcb6
chore: Use grep -E / grep -F instead of egrep / fgrep (#2164)
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
2022-10-13 10:34:57 -07:00
Brian Phillips e5e7785c96
Update variable name to match projects.plugin.bash
The projects plugin was changed to reference `BASH_IT_PROJECT_PATHS` but the completion was still using `PROJECT_PATHS`
2022-08-30 13:21:03 -05:00
Gurkirat Singh e11576f260
fix (completion): shfmt format flutter.completion.bash 2022-05-06 23:32:47 +05:30
Gurkirat Singh 66fbed7f6f
fix (completion): format awscli 2022-03-13 05:21:13 +05:30
Ira Abramov be9a838015
Fix knife completion (#2098)
Co-authored-by: Ira Abramov <github@ira.abramov.org>
2022-03-01 23:22:56 +02: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 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
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 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 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 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
Noah Gorny 878bbe5942
Merge pull request #2042 from gaelicWizard/completion/dotnet
completion/dotnet: new completion
2022-01-25 18:16:06 +02:00
John D Pell 5f9a3f143f completion/bash-it: rename `_bash-it-comp()`
...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.
2022-01-24 21:41:23 -08:00
John D Pell 2f4ed49a71 completion/bash-it: adopt `_compreply_candidates()` 2022-01-24 21:41:13 -08:00
John D Pell e1e971c0ea completion/bash-it: use `read -a` to populate `$COMPREPLY`
This allows for spaces and special characters in file names, i.e. internaltional/unicode words.
2022-01-24 21:41:13 -08:00
John D Pell 3874ad85c2 completion/bash-it: use existing functions 2022-01-24 21:41:13 -08:00
John D Pell d7695d5456 completion/bash-it: `shfmt` 2022-01-24 21:41:13 -08:00
John D Pell 77c5f8eda9 completion/dotnet: modernize
and `shfmt`
2022-01-12 22:39:49 -08:00
John D Pell 1a48bcc852 completion/dotnet: new completion
See: https://docs.microsoft.com/en-us/dotnet/core/tools/enable-tab-autocomplete#bash
2022-01-12 22:20:25 -08:00
Noah Gorny f2bff34493
Merge pull request #2013 from gaelicWizard/completion/system
completion/system: load earlier than others
2022-01-09 01:13:23 +02:00
John D Pell 5fab574bfd completion/system: `shfmt`
My apologies to future `git blame` hunters ♥
2022-01-08 08:33:16 -08:00
John D Pell e7c3263f12 completion/system: load earlier than other completions
I chose `325` so that it's still possible to deliberately place something *before* this component, if needed somehow.
2022-01-08 08:33:16 -08:00
John D Pell 776d0b7d37 completion/svn: rename to match prior file
This way, users don't need to enable "subversion" if they had already enabled "svn".
2022-01-08 08:32:37 -08:00
John D Pell ae5131aee2 completion/subversion: load system completion
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.
2022-01-08 08:32:37 -08:00
John D Pell bb69edd795 completion/subversion: remove
Remove duplicate of subversion completion as it is already provided by system packages.
2022-01-08 08:32:37 -08:00
Noah Gorny 2e968c459c
Merge pull request #1989 from tsiflimagas/bashit-completions-performance
Bash-it completions performance improvement
2022-01-07 08:55:46 +02:00
Noah Gorny c81c9dcc8c
Merge pull request #1865 from NoahGorny/add-profile-subcommand
add profile subcommand
2022-01-03 14:00:39 +02:00
Noah Gorny 2e51e92699
Merge pull request #2000 from gaelicWizard/lint
Revert most of "Fix linting errors that snuck in."
2022-01-01 23:01:09 +02:00
Kostas Giapis 45e8c4e3cd Handle `restart` completions 2021-12-30 17:03:23 +02:00
Kostas Giapis 2a2cc72541 Make parameter truncation greedy 2021-12-30 17:01:22 +02:00
John D Pell 64f75ce22d Revert most of "Fix linting errors that snuck in."
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.
2021-12-27 16:18:20 -08:00
John D Pell 6a41dbc3f6 Add "bash-progcomp" from "https://github.com/gaelicWizard/bash-progcomp@v2.0.1"
git-vendor-name: bash-progcomp
git-vendor-dir: vendor/github.com/gaelicWizard/bash-progcomp
git-vendor-repository: https://github.com/gaelicWizard/bash-progcomp
git-vendor-ref: v2.0.1
2021-12-27 11:36:38 -08:00
John D Pell fdb50aec6b Remove defaults completion v1 2021-12-27 11:36:38 -08:00
Novite5 1065d98dbe
"pipenv --completion" is obsoleted
Reference: https://buildmedia.readthedocs.org/media/pdf/pipenv/latest/pipenv.pdf 4.2.18 Shell Completion
2021-12-12 18:11:21 +08:00
Kostas Giapis 476159eab9 Use bash features as much as possible 2021-12-11 17:48:33 +02:00
Kostas Giapis 15fe122c1f Make more variables local 2021-12-03 06:31:28 +02:00
Kostas Giapis 4d821338a3 Double quote some variables 2021-12-03 06:31:28 +02:00
Kostas Giapis 9c4f7773b9 Improve performance for the rest of bash-it completions 2021-12-03 06:31:16 +02:00
Kostas Giapis 5b29d3c6e6 Improve performance of 'bash-it enable' completions 2021-12-03 06:29:39 +02:00
cornfeedhobo 2c8ee40566
Fix linting errors that snuck in. 2021-12-02 09:14:01 -06:00
Noah Gorny cf08fcaff2
Merge pull request #1965 from gaelicWizard/completion-git
completion/git: improvements and linting
2021-10-07 00:10:47 +03:00
Noah Gorny 7fc003b7d6 completion: Add completion for bash-it profile rm/list 2021-09-29 00:30:24 +03:00
Noah Gorny eaa2f829bd completion: Add bash-it profile subcommand 2021-09-29 00:30:23 +03:00
Noah Gorny 7fb7bb9cb8
Merge pull request #1952 from gaelicWizard/uncle
lib/helpers: new function `_bash-it-find-in-ancestor()`
2021-09-28 16:51:30 +03:00
Noah Gorny 8a1dc96bc0
Merge pull request #1964 from gaelicWizard/completion-pip
completion/pip: simplify control flow
2021-09-28 15:14:58 +03:00
Noah Gorny 002a23c758
Merge pull request #1961 from gaelicWizard/completion-wpscan
completion/wpscan: simplify code flow (whitespace)
2021-09-28 15:02:25 +03:00