Commit Graph

443 Commits (2ef5d483e38d790cb1c32ea8999dfbc244ff2f91)

Author SHA1 Message Date
John D Pell 7ed12083f2 gradle: adopt `_bash_it_find_in_ancestor()` 2021-09-22 15:30:07 -07:00
John D Pell be90e655f1 completion/laravel: simplify code flow
And apply `shfmt` and fix `shellcheck`
2021-09-22 13:48:10 -07:00
Noah Gorny 8c697715eb
Merge pull request #1938 from gaelicWizard/_command_exists
Use `_command_exists` everywhere
2021-09-20 14:56:45 +03:00
Noah Gorny 4700d7bf05
Merge pull request #1935 from gaelicWizard/next
Remove Executable Bit
2021-09-20 14:49:46 +03:00
Noah Gorny 4984d7adc8
Merge pull request #1834 from NoahGorny/lazily-load-pip
completion: pip: Only invoke pip when trying to complete it
2021-09-20 14:47:41 +03:00
John D Pell fb6e05d915 completions/sqlmap: use `_command_exists`
Addresses bash-it/bash-it#1632
2021-09-19 21:58:48 -07:00
John D Pell 8e9438d715 completion/hub: use `_command_exists` 2021-09-19 21:58:48 -07:00
John D Pell 699720fe8b completion/docker-compose: use `_command_exists` 2021-09-19 21:58:48 -07:00
John D Pell 679d8b10b6 completion/gradle: use `_command_exists` 2021-09-19 21:58:48 -07:00
John D Pell 699d893bef completion/awscli: use `_command_exists` 2021-09-19 21:58:48 -07:00
John D Pell dca96e0c39 completion/consul: use `_command_exists` 2021-09-19 21:58:48 -07:00
John D Pell bb555aefbf completion/pew: use `_command_exists` 2021-09-19 21:58:48 -07:00
John D Pell ef0c64322f completion/travis: use `_command_exists` 2021-09-19 21:58:48 -07:00
John D Pell c29eb16dfc completion/git_flow: use `_command_exists` 2021-09-19 21:58:48 -07:00
John D Pell 5eccc59d27 completion/git_flow_avh: use `_command_exists` 2021-09-19 21:58:48 -07:00
John D Pell 8e169388d2 completions/laravel: use `_command_exists`
Addresses bash-it/bash-it#1632
2021-09-19 21:58:48 -07:00
John D Pell e2915df1e5 completions/wpscan: use `_command_exists`
Addresses bash-it/bash-it#1632
2021-09-19 21:58:48 -07:00
John D Pell a375e7131e Remove executable bit 2021-09-18 22:26:27 -07:00
John D Pell 5fc418e479 Use `${PWD}` instead of `$(pwd)`
Don't subshell when there's a shell parameter for it.
2021-09-18 13:15:13 -07:00
John D Pell 1f6d6aa147 Use `$PWD` instead of `\`pwd\``
Don't subshell when there's a shell parameter for it.
2021-09-18 13:14:52 -07:00
John D Pell 1c3cbf7ca6
Delete `.shellcheckrc` (#1947)
* CI: disable Ubuntu 16.04 as it's EOL

https://github.blog/changelog/2021-04-29-github-actions-ubuntu-16-04-lts-virtual-environment-will-be-removed-on-september-20-2021/

* main: lint false positive

* install: lint

* plugins/cmd-returned-notify: don't `export`

* plugins/xterm: lint

* plugins/git: lint

* plugins/goenv: lint

* plugins/alias-completion: lint false positives

* plugins/alias-completion: fix SC2155, SC2154

Declare `locals` at the top of the function

* completion: lint completions using `bash_completion` functions

Match the style of the existing code

* completion/knife: lint false positives

* completion/knife: lint

* completion/sdkman: lint

* completion/composer: lint

* Move `.shellcheckrc` under `themes/`

* lib/theme: fix SC2155, SC2154, SC2034

* lib/colors: don't warn on unused variables

We assign a large number of variables here and they may or may not be used anywhere else, so disable SC2034 for this file (only).

Alsö disable SC2005 as the functions in this file were written before `printf` was invented and have to do some fancy metascripting to get escape sequences interpreted reliably. I’m not smart enough to fix this to use `printf`, so leave it for now.

* themes/agnoster: lint

* themes: disable SC2154 for colors

Each one of these themes will need it’s own fix for SC2154, possibly upstream.

Due to the way themes are, it's entirely normal to have a *lot* of false positives for SC2034. So much so, that I have to admit that it is probably just not worth linting for SC2034 despite my dislike of blanket ignore rules.

* themes: disable SC2154, fix SC2155

Each one of these themes will need it’s own fix for SC2154, possibly upstream.

Due to the way themes are, it's entirely normal to have a *lot* of false positives for SC2034. So much so, that I have to admit that it is probably just not worth linting for SC2034 despite my dislike of blanket ignore rules.

* Delete `.shellcheckrc`

* remove executable bit
2021-09-18 12:50:59 +03:00
John D Pell feacd560b6 completion/system: update wording on shell version 2021-09-05 15:43:05 -07:00
John D Pell ecfcaba32e completion/system: accomodate multiple versions
For Homebrew, switch between v1 and v2 of bash-completion based on whether the running Bash shell is new enough to use v2.
2021-09-05 15:43:05 -07:00
John D Pell 0c412442f5 completion/system: give up hope
Give up and accept defeat that bash-completion can't reasonably be audited for unbound parameters. Wrap invocation with disabling strictness, and restore after if it was enabled.
2021-08-26 14:11:41 -07:00
John D Pell 65ef8e2e8b Use _bash_it_homebrew_check() in plugins, completions
Use new function `_bash_it_homebrew_check()` in existing plugins and completions which look for Homebrew.

Alsö, use `$OSTYPE` instead of calling external `uname` binary.
2021-08-22 12:48:48 -07:00
Noah Gorny 67eff71d72 defaults: Revert to old comparison
Also fix a small bug along the way :)
2021-08-15 21:28:00 +03:00
John D Pell de9ea54b81
Don't call external `uname` when `$OSTYPE` will do (#1911)
* lib/helpers: use `$OSTYPE` instead of `$(uname)`

* plugins/osx: use `$OSTYPE` instead of `$(uname)`

* plugins/boot2docker: use `$OSTYPE` instead of `$(uname)`

* plugins/python: use `$OSTYPE` instead of `$(uname)`

* plugins/base: use `$OSTYPE` instead of `$(uname)`

Alsö, use `[[` instead of `[` as the former has less insane argument handling being shell syntax rather than a builtin command that must emulate being a real binary

* completion/brew: use `$OSTYPE` instead of `$(uname)`

* completion/git: use `$OSTYPE` instead of `$(uname)`

Alsö, use `[[` instead of `[`.

* completion/fabric: use `$OSTYPE` instead of `uname`

* theme/demula: use `$OSTYPE` instead of `$(uname)`

* theme/rana: use `$OSTYPE` instead of `$(uname)`
2021-08-14 10:20:12 +03:00
Kent Sutherland a6d58351e7 Fixed defaults autocompletion.
Need to use grep WITHOUT case-sensitivity. Otherwise results such as com.apple.iChat and com.apple.imagent won't be handled correctly and neither one can be completed.
Fixed another comparison that prevented "defaults read com.apple.iChat <complete>" from correctly returning the available defaults keys in that file.
2021-08-12 00:15:18 +03:00
John D Pell 893c8dbb96 completion/system: support $BASH_COMPLETION
Bash-completion supports pre-defining $BASH_COMPLETION as the path to the main script, so use that if it's defined.

Alsö, don't load homebrew's completion if we've successfully loaded one already.
2021-08-08 23:08:39 -04:00
John D Pell 43947e2cbc completion/system: prefer direct invocation
Instead of using the profile.d version, just invoke the script. The profile.d script preemptively short-circuits if it thinks that bash-completions has already been loaded, which it does by using the $BASH_COMPLETION variable, which is expressly supported by upstream to specify the location of the script...so it will entirely be never loaded if this is set.
2021-08-08 23:08:39 -04:00
Noah Gorny 9ea290a5ed
Merge pull request #1852 from tbhaxor/feature/completion/dart
Added completion for dart cli
2021-08-03 23:58:16 +03:00
Noah Gorny 61c0357414 completion: pip: Only invoke pip when trying to complete it
This should greatly reduce shell load time, as the pip invocation takes
a lot of time
2021-08-03 22:42:01 +03:00
Gurkirat Singh 682fd32a13
lint (bugfix): wpscan completion linting fix 2021-06-17 08:51:02 +05:30
Noah Gorny d3bb347786
Merge pull request #1837 from NoahGorny/vendor-jboss-completion
vendor jboss completion
2021-04-27 01:32:34 +03:00
Noah Gorny 31bea24da6
Merge pull request #1859 from tbhaxor/feature/completion/dmidecode
Feature/completion/dmidecode
2021-04-22 01:41:56 +03:00
Noah Gorny 0239ab8c31 completion: ngrok: Add --help option 2021-04-01 00:37:49 +03:00
Noah Gorny 1dfaf36d91 completion: ngrok: Only complete the list in case prev is ngrok 2021-04-01 00:37:49 +03:00
Gurkirat Singh 035fc920ad completion (improvement): remove if statement 2021-04-01 00:34:37 +03:00
Gurkirat Singh ab011cd9ba completion (improvement): fixed linting 2021-04-01 00:34:37 +03:00
Gurkirat Singh d42a1206f9 completion (feature): implemented ngrok 2021-04-01 00:34:37 +03:00
Gurkirat Singh e481eb41e5
completion (improvement): dmidecode lint fixed 2021-03-30 11:03:18 +05:30
Gurkirat Singh a3ae37b385
completion (feature): dmidecode 2021-03-30 11:01:19 +05:30
Gurkirat Singh ed97b9d51f
dart completion (improvement): requested by @NoahGorny 2021-03-26 01:55:37 +05:30
Gurkirat Singh 19db142aae
completion (feature): dart cli 2021-03-26 01:43:53 +05:30
Noah Gorny 64d827c3da completion: Use vendored jboss completion
Also include new jboss5 vendored completion
2021-02-13 10:41:16 +02:00
Noah Gorny 4607ee7452
Merge pull request #1836 from buhl/django-complete
vendoring django completion
2021-02-13 10:30:31 +02:00
buhl 0e77a94140 Vendored django completion 2021-02-09 11:01:37 +01:00
buhl 7fb7e27921 Added vendored apm completion 2021-02-08 16:05:45 +01:00
Noah Gorny 2d56cc4167
Merge pull request #1788 from tbhaxor/lint/notify-send-completion
Lint/notify send completion
2021-02-08 10:24:24 +02:00
Noah Gorny 25c1c8978e
Merge pull request #1807 from NoahGorny/cleanup/composer-completions
formatted composer completion and used helper function
2021-02-06 23:32:58 +02:00
cornfeedhobo 6870abc4fc
ensure go completion works well with goenv 2021-02-06 14:34:24 -06:00
Noah Gorny e4f6006797 completion: composer: Rename _composer->__composer_completion 2021-02-06 20:37:28 +02:00
Noah Gorny 0d963b224f completion: composer: Remove uneeded local "scripts" var 2021-02-06 00:23:31 +02:00
Noah Gorny e9f28ff745 completion: composer: Add shellcheck directives 2021-02-06 00:23:31 +02:00
Gurkirat Singh dbfcb431a8 formatted composer completion and used helper function 2021-02-06 00:23:31 +02:00
Gurkirat Singh 1d2a2fcd9a added completion for notify-send command 2021-02-06 00:23:14 +02:00
Noah Gorny e8dc0f7434 deprecation: Replace errors with warnings
Deprecated component is not an error, but instead should be a warning to
the user
2021-01-29 16:06:53 +02:00
Noah Gorny 2500fe7dda docker-machine: Deprecate both plugin and completion file 2021-01-29 16:06:51 +02:00
Noah Gorny b6d95c71ce completion: lerna: Add shellcheck ignore directive 2021-01-28 20:53:34 +02:00
Gurkirat Singh 69e5a28ed3 formatted lerna completion and used helper function 2021-01-28 20:53:34 +02:00
Gurkirat Singh 3d3322d0c9 formatted npm completion and used helper function 2021-01-28 19:23:56 +02:00
Gurkirat Singh 645054a8c4 formatted minikube completion and used helper function 2021-01-28 19:18:36 +02:00
Gurkirat Singh 202531321d formatted kubectl completion and used helper function 2021-01-28 18:57:00 +02:00
Gurkirat Singh d4bf4e6a89 formatted kontena completion and used helper function 2021-01-28 18:32:51 +02:00
Gurkirat Singh 714bf84528 formatted jungle completion and used helper function 2021-01-28 18:10:25 +02:00
Noah Gorny 42695c22d0 completion: gem: Fix completion file 2021-01-28 17:55:51 +02:00
Gurkirat Singh a8695edc8f formatted gem completion 2021-01-28 17:55:50 +02:00
Noah Gorny 5df1e653d9 completion: pip: Lint all pip files and clarify comment 2021-01-28 17:46:22 +02:00
Gurkirat Singh 7959acddd9 formatted pip pip3 and pipenv completion and used helper functions 2021-01-28 17:45:06 +02:00
Noah Gorny adc77bb622 completion: Lint github-cli completion and use completion_exists 2021-01-28 17:40:35 +02:00
Gurkirat Singh 759cdd5a6d formatted github-cli completion 2021-01-28 17:40:20 +02:00
Gurkirat Singh 9915f85e8b formatted helm completion and used helper function 2021-01-28 17:30:26 +02:00
Noah Gorny 067149725d completion: Add about-completion to gcloud 2021-01-28 17:18:52 +02:00
Gurkirat Singh ba5700e555 formatted gcloud completion and used helper function 2021-01-28 17:18:51 +02:00
Noah Gorny 2e3cf0b3c0 completion: Lint docker completion and add about-completion 2021-01-28 17:03:25 +02:00
Gurkirat Singh 846a576978 formatted consul completion and used helper function 2021-01-28 16:35:55 +02:00
Gurkirat Singh f9bc244718 formatted conda completion and used helper function 2021-01-28 16:27:34 +02:00
Gurkirat Singh b93ac7785c formatted awless completion and used helper function 2021-01-28 16:19:48 +02:00
Noah Gorny 37a7fac128 completion: brew: Add shellcheck ignore directives 2021-01-28 16:09:02 +02:00
Gurkirat Singh 1d569573da formatted brew completion 2021-01-28 16:09:00 +02:00
Noah Gorny 70f0111f69 completion: vue: Remove uneeded condition
Also move the shellcheck warnings to be on their respective line
2021-01-23 23:14:24 +02:00
Gurkirat Singh 812efaab90 added vuejs completion in clean_files 2021-01-23 23:14:24 +02:00
Noah Gorny a0ea33d671
Merge pull request #1778 from tbhaxor/bugfix/vue-routes
fixed existing completion and added conditional completion
2021-01-13 19:06:10 +02:00
Marcos Pereira 08ff08e043
Support multiple sdkman output formats
sdkman has a specific output format for Java candidate since
there are multiple vendors and builds. For example, when running
`sdk list maven`, the format is a simple list like:

    3.6.2
    3.6.1
    3.6.0
    3.5.4
    3.5.3
    3.5.2
    3.5.0
    3.3.9

But for `sbt list java`, the output is a table like:

    ================================================================================
     Vendor        | Use | Version      | Dist    | Status     | Identifier
    --------------------------------------------------------------------------------
     AdoptOpenJDK  |     | 15.0.1.j9    | adpt    |            | 15.0.1.j9-adpt
                   |     | 15.0.1.hs    | adpt    | installed  | 15.0.1.hs-adpt
     ...
     Amazon        |     | 15.0.1       | amzn    |            | 15.0.1-amzn
                   |     | 11.0.9       | amzn    |            | 11.0.9-amzn
     ...
     Azul Zulu     |     | 15.0.1       | zulu    |            | 15.0.1-zulu
                   |     | 15.0.1.fx    | zulu    |            | 15.0.1.fx-zulu
     ...

Therefore, the completion script has to handle both formats.
2021-01-11 11:16:15 -05:00
Gurkirat Singh 6065d003e8
fixed existing completion and added conditional completion 2021-01-10 00:34:14 +05:30
David Farrell e932d8371f
Add hooks to check .sh and .bash headers - Fixes #1491 (#1765)
* Add hooks to check .sh and .bash headers
* Adds hooks/ to clean_files.txt
2021-01-09 18:02:26 +02:00
Marcos Pereira fe7d3ef177
Format sdkman bash completion with shfmt 2021-01-08 16:42:18 -05:00
Marcos Pereira 56348b1a12
Add sdkman bash completion to clean_files 2021-01-08 16:38:08 -05:00
Marcos Pereira 5ca2c43aed
Add support to newer versions of sdkman
Some new commands are available, and also aliases
for commands such as `i` for `install`.
2021-01-04 18:18:13 -05:00
Noah Gorny 8e73b538ea Deprecate homesick completion as it is unlicensed 2020-12-29 21:49:47 +02:00
Noah Gorny 012552d8b7 Deprecate drush completion as it is GPLv2 2020-12-29 21:49:47 +02:00
Noah Gorny a369cc7c0a Deprecate virsh completion as it is GPLv2 2020-12-29 21:49:47 +02:00
Noah Gorny cd44880c15 Deprecate todo completion scripts as it is GPLv3 2020-12-29 21:49:47 +02:00
Noah Gorny 292da7ef77 Add license notice to jboss7 completion 2020-12-29 21:49:47 +02:00
Noah Gorny 59439c2f62 Add license notice to docker-machine/compose completion 2020-12-29 21:49:47 +02:00
Noah Gorny 8cc7327c0b Add license notice to salt completion 2020-12-29 21:49:47 +02:00
Noah Gorny 5188b3b0c0 Add license notice to gulp and grunt completion 2020-12-29 21:49:47 +02:00
Noah Gorny 334005ead3 Clean up vault completion and add to clean_files.txt 2020-12-29 21:49:42 +02:00
Noah Gorny 6eb5802080 Add license notice to hub completion 2020-12-29 21:49:10 +02:00
Noah Gorny 3ba1a14eb9 Remove broken link from tmux completion 2020-12-29 21:49:10 +02:00