413 Commits

Author SHA1 Message Date
Noah Gorny
e89403d59b Merge pull request #1881 from NoahGorny/lint-pure-theme
Refactor scm_prompt usage in many themes
2021-08-03 23:22:09 +03:00
cornfeedhobo
e13f7d1b07 Merge pull request #1901 from cornfeedhobo/libera-chat
move to Libera.Chat
2021-07-11 11:30:21 -05:00
cornfeedhobo
aad58bc910 move to Libera.Chat 2021-07-06 22:21:46 -05:00
Ron Green
d4ebba174c feat(git): add git unpushed alias (#1897)
* feat(git): add git unpushed alias
2021-06-23 15:02:04 +03:00
Zhengnan Zhao
0f3e4dc8be Have git check out main branch if present (#1886)
Create function to get default git branch, and use main branch if present
2021-06-23 13:26:48 +03:00
Gurkirat Singh
e51fe1fe2b Abort upgrade if unsaved changes found in bashit directory (#1890)
helper (improvement): added safeguard for unsaved changes
2021-06-23 13:25:42 +03:00
Noah Gorny
d979c32c8a Merge pull request #1891 from tbhaxor/bugfix/helper/upgrade
Replace reload with restart bash it after upgrade
2021-06-23 13:24:49 +03:00
Noah Gorny
f6e3fc358c Merge pull request #1898 from tbhaxor/bugfix/lint/wpscan
FIxed wpscan completion linting
2021-06-23 13:22:25 +03:00
Noah Gorny
e70211549f Merge pull request #1899 from georgettica/georgettica/bump-pre-commit-hooks
chore(pre-commit): bump version
2021-06-23 13:21:06 +03:00
Ron Green
a3f5b5f29a chore(pre-commit): bump version
done in the beginning because of build issues, but was solved during the work on #1897
2021-06-17 10:37:19 +03:00
Gurkirat Singh
682fd32a13 lint (bugfix): wpscan completion linting fix 2021-06-17 08:51:02 +05:30
Gurkirat Singh
01b916c544 helpers (bugfix): restart bashit after upgrade 2021-06-11 12:41:28 +05:30
ofir shtrull
2444a57cc5 feat: add k8s namespace indicator (#1887)
* Add k8s namespace to prompt
2021-06-10 16:04:56 +03:00
Noah Gorny
9b62a5c4df Merge pull request #1888 from clupasq/feature/powerline-command-duration
Add command duration to the powerline theme family
2021-06-10 16:04:28 +03:00
Cristian Lupascu
1e6113f7b7 Add command duration to the powerline theme family
Fix the __powerline_duration_prompt: location & unused variable `prompt`

Remove the duration segment from powerline* theme defaults

Different color for duration prompt segment
2021-06-05 13:47:54 +03:00
Noah Gorny
dff892e0a3 themes: Adapt themes to new scm_prompt api 2021-05-16 19:17:02 +03:00
Noah Gorny
2ae0350f5d themes: base: Add unified scm_prompt function 2021-05-16 19:17:02 +03:00
Noah Gorny
b65a7cc67c themes: Lint pure theme 2021-05-16 13:59:18 +03:00
Noah Gorny
7f193a2e05 Add pure theme to clean_files.txt 2021-05-16 13:52:36 +03:00
Noah Gorny
8c47706139 Merge pull request #1877 from NoahGorny/fix-alias-completion-for-real
plugins: Fix alias-completion by comparing completions to alias literally
2021-05-15 18:58:15 +03:00
Noah Gorny
2120be9372 plugins: Fix alias-completion by using helper util
By using _bash-it-array-contains-element, we can safetly iterate over
elements in the $completions array
2021-05-15 11:42:10 +03:00
Noah Gorny
476c568566 Merge pull request #1874 from oliverralbertini/add-hg-bookmarks-support
[base.theme] add support for hg's bookmarks feature
2021-05-08 00:13:20 +03:00
Oliver Ruben Albertini
26118d1835 [base.theme] add support for hg's bookmarks feature
Will conditionally show the branch based on the current bookmark instead
of branch.
2021-04-27 11:36:14 -07:00
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
b8da4cb68c Merge pull request #1875 from NoahGorny/fix-alias-completion
plugins: alias-completion: Revert back to read without -r
2021-04-23 17:05:17 +03:00
Noah Gorny
940739a8a0 Merge pull request #1873 from NoahGorny/improve-clean-files-txt
Add clean_files.txt sorting hook
2021-04-23 00:19:05 +03:00
Noah Gorny
716b49fa0e lint: Sort clean_files.txt according to check-clean-files-txt.sh 2021-04-22 20:53:30 +03:00
Noah Gorny
e15b53ea61 hooks: Use compat31 in check-clean-files-txt.sh 2021-04-22 20:53:30 +03:00
Noah Gorny
1b7448bc9d plugins: alias-completion: Revert back to read without -r 2021-04-22 20:38:30 +03:00
Noah Gorny
d0aa9cb542 hooks: Add check-clean-files-txt.sh 2021-04-22 01:48:20 +03:00
Noah Gorny
c731e45770 lint: Make clean_files.txt more tidy 2021-04-22 01:48:13 +03:00
John Fred Fadrigalan
7b8dbd39bc Clean alias completion plugin (#1872)
* Sort plugins/available

* Clean alias-completion plugin

* Fix shellcheck warning. SC1090

* Change shellcheck source to /dev/null for explicity

* Disable shellcheck warning SC2162
2021-04-22 01:46:50 +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
7cd94e1f7f Merge pull request #1870 from cevhyruz/clean-candy-theme
Clean candy theme
2021-04-19 21:49:23 +03:00
John Fred Fadrigalan
370c5b349e Sort theme section 2021-04-20 01:48:37 +08:00
John Fred Fadrigalan
c0fa514f7d Place 'theme/clean' alphabetically on clean_files.txt 2021-04-20 01:40:52 +08:00
John Fred Fadrigalan
409e18f7cb Clean candy theme 2021-04-20 01:18:40 +08:00
Noah Gorny
5e723842b8 Merge pull request #1869 from NoahGorny/add-restart-docs
docs: Add a section about bash-it restart
2021-04-14 19:28:12 +03:00
Noah Gorny
7e620fed63 docs: Add a section about bash-it restart 2021-04-14 16:55:23 +03:00
Noah Gorny
58f2240789 Merge pull request #1845 from NoahGorny/docs-add-logo
docs: Add logo of bash-it to readme
2021-04-08 21:48:31 +03:00
Noah Gorny
2201f6658b Add 2021 to license 2021-04-06 20:59:08 +03:00
Noah Gorny
c7f125a85d docs: Improve readme readability 2021-04-06 20:58:26 +03:00
Noah Gorny
80f143c90b docs: Add nice badges to readme 2021-04-06 20:56:31 +03:00
Noah Gorny
5d809dd73d docs: Add logo of bash-it to readme 2021-04-06 20:56:31 +03:00
Noah Gorny
ebe59c9adc Merge pull request #1850 from tbhaxor/feature/completion/ngrok
Added completion for ngrok tool
2021-04-04 22:36:13 +03:00
Noah Gorny
a6e2c2fc13 Merge pull request #1863 from artemkovalyov/patch-2
add --no-start to docker-compose up command
2021-04-04 22:35:19 +03:00
Noah Gorny
6678788f19 Merge pull request #1857 from bingzhangdai/bindai/extract-plugin
Update extract.plugin.bash, extract compressed file to target directory
2021-04-04 22:34:48 +03:00
Noah Gorny
4f0fa7ebe7 Merge pull request #1862 from NoahGorny/fix-install-error
install: Dont quote number vars, to support older bash versions
2021-04-04 22:34:25 +03:00
Artem Kovalov
905abd37f8 add --no-start to up command 2021-04-03 13:15:04 +02:00
Noah Gorny
a8b43620f8 install: Dont quote number vars, to support older bash versions 2021-04-01 17:59:59 +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
Noah Gorny
e06066c367 Merge pull request #1842 from Titivoot/master
easy theme added
2021-04-01 00:35:15 +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
Noah Gorny
ce854255b4 Merge pull request #1833 from NoahGorny/add-license-to-docs
add license to docs
2021-04-01 00:29:07 +03:00
Noah Gorny
9524bf85ae docs: Add easy theme to themes image list 2021-04-01 00:28:28 +03:00
Titivoot Pangrit
6866648ac6 Add theme Easy 2021-04-01 00:28:28 +03:00
Noah Gorny
514a753901 Merge pull request #1858 from lintonf/patch-1
Fix spelling mistake with terraform destroy alias
2021-03-31 23:56:58 +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
Linton Fisher
0b808b17f1 Fix spelling mistake 2021-03-30 00:57:13 +01:00
Noah Gorny
4860fb8c60 Merge pull request #1849 from tiagobarros99/purity-add-virtualenv
purity theme, added virtualenv name display
2021-03-25 19:16:35 +02:00
tiago
cda81f3d74 cleaned and linted purity theme 2021-03-24 21:39:57 +00:00
Bingzhang Dai
7331cd2676 Update extract.plugin.bash 2021-03-24 18:42:44 +08:00
Bingzhang Dai
399b5199b0 Update extract.plugin.bash, support to extract zip to target directory 2021-03-24 17:04:21 +08:00
Noah Gorny
eced6802d0 Merge pull request #1856 from NoahGorny/fix-typeset-command-not-found
helpers: Fix broken compoure references after vendor change
2021-03-22 21:40:29 +02:00
Noah Gorny
02f6654841 test: Add bash-it help plugins test 2021-03-21 22:07:24 +02:00
Noah Gorny
7b5f758eba helpers: Fix broken compoure references after vendor change 2021-03-21 21:52:47 +02:00
tiago
64c4c30706 minor change 2021-03-17 15:39:57 +00:00
tiago
ea444459cf improved PS1, function rename 2021-03-17 15:26:39 +00:00
Noah Gorny
6f02b8d194 Merge pull request #1851 from ofirshtrull/master
Add support for active gcloud account in powerline prompt
2021-03-15 23:01:43 +02:00
Noah Gorny
c8ef6c9146 Merge pull request #1848 from matthewadams/master
add npm alias nt="npm test"
2021-03-13 18:55:02 +02:00
Ofir Shtrull
8ae2b1e73d fix typo 2021-03-11 18:32:10 +02:00
Ofir Shtrull
ffc1701c0a Add to prompt google gcloud active account 2021-03-11 18:25:23 +02:00
tiago
682d6d728d added python's virtualenv name 2021-03-10 15:24:32 +00:00
Matthew Adams
96586dd575 add alias nt="npm test" 2021-03-09 14:14:19 -06:00
Noah Gorny
c59886b8ab Merge pull request #1847 from tbhaxor/patch-2
Added alias for git rebase
2021-03-09 00:15:58 +02:00
Gurkirat Singh
5c6306deb7 alias (improvement): continue rebase after conflict resolve 2021-03-09 02:24:12 +05:30
Noah Gorny
6093ecbb60 Merge pull request #1841 from ddaza/master
fix: Git alias quote style broke functionality
2021-02-26 10:17:01 +02:00
ddaza
e289549a50 fix alias quotes 2021-02-25 19:45:59 -06:00
Artem Kovalov
9d7738d14d Improved systemd aliases
Refactor naming
Add restart
2021-02-25 00:01:38 +02:00
Noah Gorny
7827907154 Merge pull request #1838 from bialad/patch-1
Remove deprecated kubectl run --generator
2021-02-24 19:06:55 +02:00
Tobias Månsson
0ed6f045f6 Remove deprecated kubectl run --generator
It now defaults to pod, so the --generator option is not required.
2021-02-15 07:41:39 +01:00
Noah Gorny
64d827c3da completion: Use vendored jboss completion
Also include new jboss5 vendored completion
2021-02-13 10:41:16 +02:00
Noah Gorny
a30a76906c Add "jboss-completion" from "https://github.com/rparree/jboss-bash-completion@master"
git-vendor-name: jboss-completion
git-vendor-dir: vendor/github.com/rparree/jboss-bash-completion
git-vendor-repository: https://github.com/rparree/jboss-bash-completion
git-vendor-ref: master
2021-02-13 10:34:49 +02:00
Noah Gorny
e89948a7f0 Squashed 'vendor/github.com/rparree/jboss-bash-completion/' content from commit fc87d94
git-subtree-dir: vendor/github.com/rparree/jboss-bash-completion
git-subtree-split: fc87d94e7da9431133190f60f5a84367e44d650c
2021-02-13 10:34:49 +02:00
Noah Gorny
4607ee7452 Merge pull request #1836 from buhl/django-complete
vendoring django completion
2021-02-13 10:30:31 +02:00
Noah Gorny
0eab2962d3 Merge pull request #1835 from buhl/vendor-apm-completion
Vendor apm completion
2021-02-12 15:50:42 +02:00
buhl
0e77a94140 Vendored django completion 2021-02-09 11:01:37 +01:00
buhl
a0ba2a1787 Add "django-completion" from "https://github.com/django/django@3.1.6"
git-vendor-name: django-completion
git-vendor-dir: vendor/github.com/django/django
git-vendor-repository: https://github.com/django/django
git-vendor-ref: 3.1.6
2021-02-09 10:56:10 +01:00
buhl
0dd01da4b7 Squashed 'vendor/github.com/django/django/' content from commit 32bb1421
git-subtree-dir: vendor/github.com/django/django
git-subtree-split: 32bb1421ae4bf8e3b730be0cb47ee026a72961f7
2021-02-09 10:45:13 +01:00
buhl
7fb7e27921 Added vendored apm completion 2021-02-08 16:05:45 +01:00
buhl
751d3e2496 Add "apm-completion" from "https://github.com/vigo/apm-bash-completion@master"
git-vendor-name: apm-completion
git-vendor-dir: vendor/github.com/vigo/apm-bash-completion
git-vendor-repository: https://github.com/vigo/apm-bash-completion
git-vendor-ref: master
2021-02-08 16:05:40 +01:00
buhl
e8342c1d97 Squashed 'vendor/github.com/vigo/apm-bash-completion/' content from commit d44593c
git-subtree-dir: vendor/github.com/vigo/apm-bash-completion
git-subtree-split: d44593c3f0514e1fcc668e47f875f83ceb054b36
2021-02-08 16:05:40 +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
133e48229a Merge pull request #1832 from cornfeedhobo/gocomplete
ensure go completion works well with goenv
2021-02-06 15:27:12 -06:00
Noah Gorny
e25e371ba7 docs: Add newline in readme and index.rst 2021-02-06 23:17:18 +02:00
Noah Gorny
e4e0c151b2 docs: Add license notice to readme 2021-02-06 23:16:58 +02:00
Noah Gorny
db318cdd3e Merge pull request #1830 from NoahGorny/simplify-install
simplify install
2021-02-06 22:57:17 +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
5c192575ce install: Add bash-it prefix to all functions 2021-02-06 20:36:04 +02:00
Noah Gorny
3e7adde638 install: Move to double brackets in check_for-backup check 2021-02-06 20:25:56 +02:00
Noah Gorny
fe9ef1e4bd Merge pull request #1816 from tbhaxor/lint/git-plugins
Lint/git plugins
2021-02-06 00:31:41 +02:00
Noah Gorny
75058ebf22 plugins: git: Fix git_stats
Also remove uneeded newline
2021-02-06 00:26:15 +02:00
Gurkirat Singh
5cb52fa239 fixed linting for plugins/available/git.plugin.bash file 2021-02-06 00:26:15 +02:00
Gurkirat Singh
77654875e5 fixed git-changelog plugin 2021-02-06 00:26:12 +02:00
Gurkirat Singh
63f9f660a9 credit given to original author 2021-02-06 00:25:33 +02:00
Gurkirat Singh
92d814b2f6 added plugin to create git changelog and formatted code 2021-02-06 00:25:33 +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
af17501318 install: Add --overwrite-backup flag
This will ensure users will specify whether they want to overwrite the
backup or not, and check it even when we do silent installation
This does change the default behaviour and exits if the -f flag is not
specified and a backup is present.
2021-02-06 00:15:20 +02:00
Noah Gorny
9e37f0d09e install: Move backup check into a separate function 2021-02-06 00:15:20 +02:00
Noah Gorny
ef10bcd151 install: Move modify config check into separate function
This helps us make the logic easier to read, and remove unneeded
confusion.
2021-02-06 00:15:20 +02:00
Noah Gorny
1fbd91ebf9 Merge pull request #1824 from cornfeedhobo/goenv-go
Ensure goenv and go play together well
2021-02-06 00:14:07 +02:00
Noah Gorny
71116f785f Merge pull request #1828 from cornfeedhobo/composure-bump
Composure bump
2021-02-05 10:51:28 +02:00
cornfeedhobo
84049a4542 Update "composure" from "https://github.com/erichs/composure@55fdb9fa3cd0f181208a46d90da4d87d5b7e4351"
git-vendor-name: composure
git-vendor-dir: vendor/github.com/erichs/composure
git-vendor-repository: https://github.com/erichs/composure
git-vendor-ref: 55fdb9fa3cd0f181208a46d90da4d87d5b7e4351
2021-02-05 00:15:02 -06:00
cornfeedhobo
aebe193136 Squashed 'vendor/github.com/erichs/composure/' changes from 5c3698d..55fdb9f
55fdb9f Merge pull request #24 from bvberkum/pr-21
b360ca5 Use command name, not last argument as shell-name [#23]
5c458c9 22 - Document revise behavior with GUI editors
7de4304 Update LICENSE copyright
f784e3a Merge pull request #20 from akatrevorjay/pr/zsh-plugin
1901dbe Merge pull request #19 from DrVanScott/master
6bcbc7b Add zsh-style plugin for easy load
37bccee fix _typeset_functions_about for functions starting with a dash
27623a9 fix zsh specific issues
2efc446 glossary: list only functions containing 'about'
7899d11 glossary: call _typeset_functions only once
072856e shell(): Fix for cygwin environment
2dc31de avoid error message if gprintf does not exist

git-subtree-dir: vendor/github.com/erichs/composure
git-subtree-split: 55fdb9fa3cd0f181208a46d90da4d87d5b7e4351
2021-02-05 00:15:02 -06:00
cornfeedhobo
e690f21e4e Ensure goenv and go play together well
This PR seeks to address several issues surrounding the go and goenv plugins.
The nature of goenv allows for a situation where the initial shell does not
point to a working go binary, and instead at the included shim script. The
result is that one must run reload after moving to a project directory with a
version file, however in doing so, PATH is updated, requiring they exit the
shell or risk lookup collisions and unexpected behavior.

This is solved by using preexec to check the version before changing
directories and restarting the shell if the version has changed. The exec
pattern is copied from _bash-it-restart, but is edited to support this specific
use case.

Additionally, tests have been uploaded and these are now being linted.
2021-02-04 23:51:17 -06:00
cornfeedhobo
ff2f961ad7 Merge pull request #1822 from cornfeedhobo/stop-changing-working-directory
use absolute paths instead of changing directory
2021-02-03 09:05:59 -06:00
Noah Gorny
ce6487f63e Merge pull request #1820 from buhl/composure
Vendoring the composure
2021-02-03 09:06:35 +02:00
buhl
49d7d2e8c4 Getting Bash-it to use the vendored composure
Fixed tests
Fixed install.sh and bash_it.sh
Added gitattributes to the vendor folder
Changed documentation
2021-02-02 16:34:04 +01:00
cornfeedhobo
8fcf713541 use absolute paths instead of changing directory 2021-01-31 15:32:23 -06:00
buhl
90dd69c8ad Squashed 'vendor/github.com/erichs/composure/' content from commit 5c3698d
git-subtree-dir: vendor/github.com/erichs/composure
git-subtree-split: 5c3698df33cf92f9dbe75b807b1d29729989baaa
2021-01-31 14:56:34 +01:00
buhl
a0b6c4993a Add "composure" from "https://github.com/erichs/composure@1.3.1"
git-vendor-name: composure
git-vendor-dir: vendor/github.com/erichs/composure
git-vendor-repository: https://github.com/erichs/composure
git-vendor-ref: 1.3.1
2021-01-31 14:56:34 +01:00
Noah Gorny
293d86771a Merge pull request #1779 from NoahGorny/deprecate-docker-machine
docker-machine: Deprecate both plugin and completion file
2021-01-29 16:48:07 +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
1ce93fd60e Merge pull request #1795 from NoahGorny/cleanup/lerna-completions
formatted lerna completion and used helper function
2021-01-29 01:27:16 +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
Noah Gorny
28b2a2ba2b Merge pull request #1797 from NoahGorny/cleanup/npm-completions
formatted npm completion and used helper function
2021-01-28 19:34:45 +02:00
Gurkirat Singh
3d3322d0c9 formatted npm completion and used helper function 2021-01-28 19:23:56 +02:00
Noah Gorny
6fb9379f92 Merge pull request #1796 from NoahGorny/cleanup/minikube-completions
formatted minikube completion and used helper function
2021-01-28 19:22:23 +02:00
Gurkirat Singh
645054a8c4 formatted minikube completion and used helper function 2021-01-28 19:18:36 +02:00
Noah Gorny
868d64ebb8 Merge pull request #1793 from NoahGorny/cleanup/kubectl-completions
formatted kubectl completion and used helper function
2021-01-28 19:16:51 +02:00
Gurkirat Singh
202531321d formatted kubectl completion and used helper function 2021-01-28 18:57:00 +02:00
Noah Gorny
253e87e4a2 Merge pull request #1792 from NoahGorny/cleanup/kontena-completion
formatted kontena completion and used helper function
2021-01-28 18:55:14 +02:00
Gurkirat Singh
d4bf4e6a89 formatted kontena completion and used helper function 2021-01-28 18:32:51 +02:00
Noah Gorny
0748b3085e Merge pull request #1799 from NoahGorny/cleanup/jungle-completions
formatted jungle completion and used helper function
2021-01-28 18:16:24 +02:00
Gurkirat Singh
714bf84528 formatted jungle completion and used helper function 2021-01-28 18:10:25 +02:00
Noah Gorny
391ce6e91f Merge pull request #1802 from NoahGorny/cleanup/gem-completions
formatted gem completion
2021-01-28 18:07:51 +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
71c0c06a78 Merge pull request #1798 from NoahGorny/cleanup/pip-completions
cleanup/pip completions
2021-01-28 17:54:59 +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
c2d971f20e Merge pull request #1801 from NoahGorny/cleanup/gh-completions
cleanup/gh completions
2021-01-28 17:44:21 +02:00
Noah Gorny
adc77bb622 completion: Lint github-cli completion and use completion_exists 2021-01-28 17:40:35 +02:00
Noah Gorny
2b66100c47 helpers: Add _completion_exists helper 2021-01-28 17:40:20 +02:00
Gurkirat Singh
759cdd5a6d formatted github-cli completion 2021-01-28 17:40:20 +02:00
Noah Gorny
8969f018a4 Merge pull request #1800 from NoahGorny/cleanup/helm-completions
formatted helm completion and used helper function
2021-01-28 17:36:23 +02:00
Gurkirat Singh
9915f85e8b formatted helm completion and used helper function 2021-01-28 17:30:26 +02:00
Noah Gorny
94a9c639c7 Merge pull request #1803 from NoahGorny/cleanup/gcloud-completions
cleanup/gcloud completions
2021-01-28 17:28:12 +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
8dfc4cee20 Merge pull request #1804 from NoahGorny/cleanup/docker-completions
completion: Lint docker completion and add about-completion
2021-01-28 17:17:55 +02:00
Noah Gorny
2e3cf0b3c0 completion: Lint docker completion and add about-completion 2021-01-28 17:03:25 +02:00
Noah Gorny
5b51842b54 Merge pull request #1805 from NoahGorny/bugfix/consul-completions
formatted consul completion and used helper function
2021-01-28 16:56:10 +02:00
Gurkirat Singh
846a576978 formatted consul completion and used helper function 2021-01-28 16:35:55 +02:00
Noah Gorny
284819e718 Merge pull request #1806 from NoahGorny/cleanup/conda-completions
formatted conda completion and used helper function
2021-01-28 16:34:51 +02:00
Gurkirat Singh
f9bc244718 formatted conda completion and used helper function 2021-01-28 16:27:34 +02:00
Noah Gorny
2c429e5bb1 Merge pull request #1809 from NoahGorny/cleanup/awless-completions
formatted awless completion and used helper function
2021-01-28 16:24:33 +02:00
Gurkirat Singh
b93ac7785c formatted awless completion and used helper function 2021-01-28 16:19:48 +02:00
Noah Gorny
ef110e167c Merge pull request #1808 from NoahGorny/cleanup/brew-completions
formatted brew completion
2021-01-28 16:19:09 +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
0d0fde9904 Merge pull request #1813 from NoahGorny/improve-test-helper
test: helper: cite plumbing metadata
2021-01-28 16:08:03 +02:00
Noah Gorny
25b3c96f43 Merge pull request #1817 from tiagobarros99/cleanup/modern-theme
Cleanup for modern theme
2021-01-28 12:25:07 +02:00
tiago
cb5047734b retval check 2021-01-27 22:55:44 +00:00
tiago
3a846a2d47 cleanup modern theme 2021-01-27 22:55:44 +00:00
Noah Gorny
2388c74d84 Merge pull request #1776 from buhl/vendor
Add git vendor and vendor pre-exec lib
2021-01-27 23:25:30 +02:00
Noah Gorny
c79d6cd609 vendor: Add init.d directory to clean_files.txt
Also fix and lint the directory.
This is our code, and as such, should be linted.
2021-01-27 23:21:14 +02:00
Noah Gorny
9b04e11bfc Merge branch 'master' into vendor 2021-01-27 16:43:34 +02:00
Noah Gorny
4f8fd5957f Merge pull request #1780 from tbhaxor/lint/vue-completions
Lint/vue completions
2021-01-26 20:03:34 +02:00
Noah Gorny
7b817f388d Merge pull request #1790 from BarbUk/clean/theme_starting_by_b
Clean b* themes
2021-01-26 19:57:45 +02:00
Noah Gorny
2db806fe0d Merge pull request #1812 from tiagobarros99/fix-modern-theme
modern theme, added virtualenv name display, changed first bracket and second bracket
2021-01-26 19:56:44 +02:00
tiago
e80e29be6d Merge remote-tracking branch 'upstream/master' into fix-modern-theme 2021-01-24 14:09:48 +00: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
49cf84c4fe test: helper: cite plumbing metadata 2021-01-23 23:04:29 +02:00
Noah Gorny
6b3788051f test: plugin: xterm: Use correct _command_exists invocation 2021-01-23 23:03:41 +02:00
Noah Gorny
046e528cc2 plugins: xterm: Fix shfmt complaints 2021-01-23 22:47:15 +02:00
buhl
29855ed1e6 Adding preexec as a vendored library
Added a vendored lib loading routine in bash-it.sh
Added documentation on how to vendor libs in bash-it
Added and fixed plugins using preexec
Added tests for two plugins
Removed the old preexec lib
2021-01-23 18:31:18 +01:00
tiago
e2be8bc2bc trailing and code style 2021-01-23 17:30:20 +00:00
buhl
5ad497924c Add "preexec" from "https://github.com/rcaloras/bash-preexec@0.4.1"
git-vendor-name: preexec
git-vendor-dir: vendor/github.com/rcaloras/bash-preexec
git-vendor-repository: https://github.com/rcaloras/bash-preexec
git-vendor-ref: 0.4.1
2021-01-23 18:28:43 +01:00
buhl
c9a7837b44 Squashed 'vendor/github.com/rcaloras/bash-preexec/' content from commit 7884535
git-subtree-dir: vendor/github.com/rcaloras/bash-preexec
git-subtree-split: 7884535ed423ac27d3b6b473c61b1fe41905aca1
2021-01-23 18:28:43 +01:00
tiago
54bf7f9a59 check if last command successful 2021-01-23 17:10:32 +00:00
tiago
bb6354e205 removed trailing spaces 2021-01-23 14:42:58 +00:00
Noah Gorny
2a2741d761 Merge pull request #1810 from NoahGorny/disable-keep-padding
Disable keep-padding option in shfmt
2021-01-23 09:45:15 +02:00
tiago
c7f6e80ad0 fix modern theme, added virtualenv name 2021-01-22 17:07:16 +00:00
BarbUk
f86d823dc3 Disable SC2207 to keep COMPREPLY simple 2021-01-22 18:41:16 +04:00
Noah Gorny
d2ab59fef8 Disable keep-padding option in shfmt
Has some serious bugs and not really needed
Also fixed all files that need to be changed after this
2021-01-21 22:08:45 +02:00
BarbUk
b92f53ece5 Update atomic theme with correct compgen syntax 2021-01-16 23:21:04 +01:00
BarbUk
ef42c822e6 Update brainy theme with correct compgen syntax 2021-01-16 23:18:58 +01:00
Noah Gorny
79df5ffc3c Merge pull request #1789 from BarbUk/fix/rbenv_version_prompt
Fix rbenv version prompt
2021-01-16 20:18:47 +02:00
Noah Gorny
18781ed397 Merge pull request #1764 from cornfeedhobo/history-plugins
refactor all history modifications into discrete plugins
2021-01-16 19:32:29 +02:00
Noah Gorny
988e966df3 Merge pull request #1773 from tbhaxor/feature/clipboard-copy
added alias for xclip command
2021-01-16 13:27:05 +02:00
BarbUk
814ff562e9 Fix rbenv version prompt 2021-01-16 09:25:12 +01:00
BarbUk
86fd073ee6 Clean brunton 2021-01-16 09:13:23 +01:00
BarbUk
662a5c4ac7 Clean brainy 2021-01-16 09:13:10 +01:00
BarbUk
eadd2685df Clean bobby 2021-01-16 09:12:59 +01:00
BarbUk
8691894175 Clean bira 2021-01-16 09:12:42 +01:00
BarbUk
cfb9a22e70 Clean binaryanomaly 2021-01-16 09:12:20 +01:00
BarbUk
fb0fa7f799 Clean bakke 2021-01-16 09:12:06 +01:00
BarbUk
59fc8c818d Update clean_files.txt 2021-01-16 09:11:26 +01:00
cornfeedhobo
4044f4123c add top-history 2021-01-15 11:57:41 -06:00
cornfeedhobo
61f727fb96 refactor all history modifications into discrete plugins 2021-01-15 11:53:28 -06:00
Noah Gorny
5e667ed476 Merge pull request #1783 from BarbUk/clean/theme_atomic_and_axin
Clean atomic and axin theme
2021-01-14 15:20:38 +02:00
BarbUk
bd6dbd3edf Merge branch 'master' into clean/theme_atomic_and_axin 2021-01-14 13:45:31 +01:00
Noah Gorny
bb35450c17 Merge pull request #1733 from tbhaxor/patch-1
Added git alias to list only conflicted files
2021-01-13 21:32:33 +02:00
Noah Gorny
610980dd23 git: aliases: Move glsu to glsum in ls-files and add glsut 2021-01-13 21:19:55 +02:00
Noah Gorny
a9b0ec7d1d Merge pull request #1785 from marcospereira/lint/themes/base.theme.bash
Add themes/base.theme.bash to clean files
2021-01-13 19:15:09 +02:00
Gurkirat Singh
957cd578f7 Added git alias to list only conflicted files 2021-01-13 19:08:41 +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
Noah Gorny
bc32b40088 Merge pull request #1784 from marcospereira/support-sdkman-different-output-formats
Support multiple sdkman output formats
2021-01-13 19:02:35 +02:00
Noah Gorny
70fa3f8d25 aliases: clipboard: Remove command_exists check 2021-01-13 18:43:04 +02:00
Noah Gorny
bac50413f1 Merge pull request #1743 from georgettica/georgettica/sort-git-aliases
refactor(aliases): sort
2021-01-13 18:40:55 +02:00
Noah Gorny
da662d1332 aliases: clipboard: Add shellcheck header 2021-01-13 18:30:32 +02:00
Gurkirat Singh
9f66059f52 aliases: clipboard: Add more aliases for xclip command
Also lint and cleanup the file
2021-01-13 18:29:57 +02:00
Noah Gorny
dd4e410a32 aliases: git: Add shellcheck header 2021-01-13 18:24:53 +02:00
Noah Gorny
8723fc56b2 aliases: git: Sort all commands, even miniscule ones 2021-01-13 18:24:16 +02:00
Ron Green
436381de93 refactor(aliases): sort git aliases file and lint it
- move all comments to the same line so they wont be jumbled
- also add to clean_files.txt
2021-01-13 18:24:13 +02:00
Marcos Pereira
94d261b42d Fix shellcheck warnings for themes/base.theme.bash 2021-01-12 00:55:15 -05:00
Marcos Pereira
5a761b7ae3 Run code fomatter for themes/base.theme.bash 2021-01-11 15:14:49 -05:00
Marcos Pereira
3f29862478 Add themes/base.theme.bash to clean files 2021-01-11 15:12:39 -05: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
BarbUk
e574abbbba Clean theme atomic 2021-01-11 11:42:04 +01:00
BarbUk
6495e3479e Clean theme axin 2021-01-11 11:41:44 +01:00
BarbUk
df73085fea Update clean file 2021-01-11 11:41:22 +01:00
Gurkirat Singh
6065d003e8 fixed existing completion and added conditional completion 2021-01-10 00:34:14 +05:30
Noah Gorny
c268cd9abc Merge pull request #1777 from NoahGorny/dnf-aliases-fedora
dnf aliases fedora
2021-01-09 20:31:05 +02:00
Noah Gorny
342ddcfca0 Add dnf.aliases.bash to clean_files.txt 2021-01-09 19:03:44 +02:00
zuck007
73d28f0b27 removing redundant lines 2021-01-09 19:03:17 +02:00
zuck007
f18562279c dnf aliases for fedora_22+ distros 2021-01-09 19:03:17 +02:00
zuck007
2ae03668c4 added dnf aliases for fedora distro 2021-01-09 19:03:17 +02:00
zuck007
91f63c0b68 adding dnf aliases for fedora distro 2021-01-09 19:03:17 +02:00
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
Noah Gorny
3fce1ffe8d Merge pull request #1775 from marcospereira/cleanup/sdkman
Add sdkman bash completion to the list of clean files
2021-01-09 00:36:44 +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
Noah Gorny
cc3bdc2b57 Merge pull request #1767 from NoahGorny/disable-macos-11
ci: Remove macos-11.0 as it is unreliable
2021-01-08 19:40:41 +02:00
Noah Gorny
d97a36af88 Merge pull request #1697 from NoahGorny/clean-agnoster-theme
clean agnoster theme
2021-01-07 20:21:43 +02:00
Noah Gorny
c5f02b769d Merge pull request #1763 from marcospereira/sdkman-update
Add support to newer versions of sdkman
2021-01-07 19:50:00 +02:00
Noah Gorny
81e3f1482b ci: Remove macos-11.0 as it is unreliable 2021-01-07 19:29:45 +02:00
Noah Gorny
c168122ff5 Add agnoster theme to clean_files.txt 2021-01-07 19:12:34 +02:00
Noah Gorny
f255d03057 shellcheck agnoster theme 2021-01-07 19:11:22 +02:00
Noah Gorny
60da498ed4 shfmt agnoster theme 2021-01-07 19:11:22 +02:00
BarbUk
ae9da3b62b Clean barbuk theme (#1766) 2021-01-07 19:05:00 +02:00
cornfeedhobo
3c00fe6dbb Merge pull request #1759 from cornfeedhobo/add-basher-plugin
add plugin for basher
2021-01-05 09:35:13 -06: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
cornfeedhobo
0b6ecf705d add plugin for basher 2021-01-02 23:05:05 -06:00
Noah Gorny
3addebb66b Merge pull request #1760 from cornfeedhobo/editorconfig-fixes
Editorconfig fixes
2021-01-02 00:42:22 +02:00
cornfeedhobo
ded58f25e3 include test/run in editorconfig 2021-01-01 14:25:23 -06:00
cornfeedhobo
b8dda491c7 fix wildcard matches to include path separators 2021-01-01 14:24:34 -06:00
Noah Gorny
13020874a9 Merge pull request #1758 from NoahGorny/update-contributing
Update contributing document
2021-01-01 11:23:04 +02:00
Noah Gorny
5487963fa7 Merge pull request #1752 from Bash-it/add-license-1
Add LICENSE
2020-12-29 22:41:34 +02:00
Noah Gorny
0565c3aa8e Merge pull request #1741 from NoahGorny/licensing
Clean up embedded licensing issues
2020-12-29 22:40:58 +02:00
Noah Gorny
3c0235b44b docs: contributing: Remove bullets already covered by our templates 2020-12-29 22:06:22 +02:00
Noah Gorny
aeb0cb7353 docs: contributing: Add section about invoking with command builtin 2020-12-29 22:06:22 +02:00
Noah Gorny
49886620c4 docs: contributing: Mention github actions instead of travis 2020-12-29 22:06:10 +02: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
Noah Gorny
f4f229573d Clean up packer completion and add to clean_files.txt 2020-12-29 21:49:10 +02:00
Noah Gorny
6a69931240 Add license to invoke completion 2020-12-29 21:49:10 +02:00
Noah Gorny
f221cdca9e Clarify license on bundler completion 2020-12-29 21:49:10 +02:00
Noah Gorny
17211b0b1a Add license to apm completion script 2020-12-29 21:49:10 +02:00
Noah Gorny
2329b4395b Add license notice to gradle completion 2020-12-29 21:49:10 +02:00
Noah Gorny
3a2ccd3792 Add license notice to django completion 2020-12-29 21:49:10 +02:00
Noah Gorny
1d4b325ce9 Merge pull request #1734 from georgettica/patch-2
feat(vim-alias): add full screen help
2020-12-28 21:39:43 +02:00
Noah Gorny
a1da0087a1 Merge pull request #1748 from NoahGorny/fix-git-url-in-bashit-version
version: Fix url in case it is ssh based one
2020-12-28 21:35:53 +02:00
Ron Green
d6e2b04708 fix(vim-aliases): join '$VIM' statements 2020-12-28 10:58:09 +02:00
Noah Gorny
908fed9f50 Merge pull request #1738 from NoahGorny/fix-1354
Use command rm in alias_completion
2020-12-27 19:11:11 +02:00
BarbUk
13e795c995 add command time duration plugin (#1683) 2020-12-27 18:48:17 +02:00
Ron Green
e94b9420ac fix(vim-aliases): make alias dependant on envvar 2020-12-27 18:05:11 +02:00
Russell
b119540ce7 Add comment to install "t" and disable "todo.plugin" (#1742)
This commit is intended to help new uses of the
modern-t theme get it set up properly
and avoid the "todo.plugin" breaking it

Please see the following issues for details.
https://github.com/Bash-it/bash-it/issues/1693
https://github.com/Bash-it/bash-it/issues/1374

Co-authored-by: Russell Adams <russell.adams@avast.com>
2020-12-27 17:24:52 +02:00
Noah Gorny
d2a5524556 Add LICENSE
Woohoo!  
What a time to be alive 😄
2020-12-27 17:17:51 +02:00
Terminal for Life
921ea9ac76 Optimizations to reloader.bash (#1749)
* Optimized statement with REGEX by using `case`

REGEX is a great feature of BASH, but in this case it was energy
needlessly spent. A `case` statement suffices. Bring in REGEX when
you're going to make good use of it, otherwise it's just going to bog
down your code.

I also wanted to strip the ` || exit 1` on the last line, but I wasn't
sure if this file is meant to be sourced or not; if not, then exiting
like that is redundant because it will already exit with whichever
status the last command provides, unless `popd` specifically offers
unhelpful or no exit statuses.

* Optimize as before but with 2nd REGEX instance

This time is much like the last commit, so I won't repeat, but I will
say that you're using a double- or even triple-negative, which
obfuscates your goal. Where you were doing...

[ ! -n VAR ] &&

You were basically saying this convolution:

If it's true that it's not true that VAR is not empty.

Very confusing. Instead, I've opted for:

If it's true that Var is empty.

Makes immediate sense and is easier to parse, visually speaking.
2020-12-27 17:14:50 +02:00
Noah Gorny
b19c2b969f test: Change alias-completion completion file to capistrano 2020-12-27 17:12:22 +02:00
Ron Green
d74cc615be feat(lint): lint vim.aliases 2020-12-23 10:19:06 +02:00
Noah Gorny
5aa2612ff1 Merge pull request #1746 from NoahGorny/add-lint-clean-files-instructions
add lint clean files instructions
2020-12-21 00:31:22 +02:00
Noah Gorny
6914a2345a version: Fix url in case it is ssh based one 2020-12-21 00:30:56 +02:00
Noah Gorny
8bc83b2d48 docs: Add lint_clean_files instructions 2020-12-20 23:29:01 +02:00
Noah Gorny
9ca6841e20 docs: Add sphinx-emoji support 2020-12-20 23:29:01 +02:00
Noah Gorny
e1372dd5bd Merge pull request #1747 from NoahGorny/add-easy-installation-docs
docs: Add simple installation instructions to readme
2020-12-18 17:15:33 +02:00
Noah Gorny
7edc26f408 Merge pull request #1727 from NoahGorny/add-issue-and-pr-templates
github: Add pr template
2020-12-18 11:48:02 +02:00
Noah Gorny
d00c478ded Merge pull request #1740 from Bash-it/NoahGorny-patch-2
Add bug+feature issue templates
2020-12-18 11:47:11 +02:00
Noah Gorny
13be44ab19 Merge pull request #1735 from NoahGorny/docs-more-improvements
docs more improvements
2020-12-17 19:10:15 +02:00
Noah Gorny
181863af1d docs: Add simple installation instructions to readme
This will help newcomers, and not confuse them by redirecting them to
another site instantly.
2020-12-17 01:42:25 +02:00
Noah Gorny
859038e58f Allow trailing spaces in md/rst files 2020-12-17 01:42:25 +02:00
Noah Gorny
501b1ab3b5 Merge pull request #1730 from NoahGorny/fix-1037
Disable auto-reload in install.sh
2020-12-16 20:08:06 +02:00
Noah Gorny
89787cf261 github: Add pr template 2020-12-16 19:46:23 +02:00
Noah Gorny
2b4a81f39c Add bug+feature issue templates 2020-12-16 19:12:54 +02:00
Ron Green
5eb023cf51 Update vim.aliases.bash 2020-12-15 22:46:47 +02:00
Noah Gorny
6008006783 Merge pull request #1736 from NoahGorny/add-irc-badge
readme: Change join chat to IRC from gitter
2020-12-14 03:41:46 +02:00
Noah Gorny
f10834275f Merge pull request #1737 from NoahGorny/add-main-page-to-readme
docs: Add readthedocs main page to readme
2020-12-14 03:40:54 +02:00
Noah Gorny
1c05d71819 alias-completion: Use 'command rm' instead of rm to avoid aliases 2020-12-14 01:25:58 +02:00
Noah Gorny
f5753e4416 test: Add test for aliases rm for alias_completion 2020-12-14 01:21:00 +02:00
Noah Gorny
654a49cbd8 docs: Add readthedocs main page to readme 2020-12-14 00:49:26 +02:00
Noah Gorny
b5fecb3eb3 readme: Add docs status badge 2020-12-14 00:47:32 +02:00
Noah Gorny
0d7f145ef4 readme: Change join chat to IRC from gitter 2020-12-14 00:28:57 +02:00
Noah Gorny
dca563e606 docs: misc: Move help_screens and proxy_support into seperate pages 2020-12-14 00:14:23 +02:00
Noah Gorny
cf2df9e896 docs: Restructure sentence about adding screenshots 2020-12-14 00:05:17 +02:00
Noah Gorny
28e4633e53 Merge pull request #1721 from NoahGorny/docs-remove-themes-readmes
docs: Remove themes readmes
2020-12-14 00:01:30 +02:00
Noah Gorny
1ab755360d Merge pull request #1704 from NoahGorny/docs-migrate-themes
Docs migrate themes
2020-12-13 23:58:45 +02:00
Noah Gorny
e7d5107007 docs: Improve contributing add-screenshot instructions 2020-12-13 23:50:27 +02:00
Noah Gorny
60c8b4be9f docs: Move powerline theme docs into powerline-base.rst 2020-12-13 23:50:27 +02:00
Noah Gorny
d3d9a79f1e docs: Update contributing theme guidelines 2020-12-13 23:50:27 +02:00
Noah Gorny
bced06994b Move theme documentation to be under docs/themes-list 2020-12-13 23:50:26 +02:00
Noah Gorny
d89651dc8d Merge pull request #1703 from NoahGorny/docs-migrating-wiki
Migrate wiki docs to rtd format
2020-12-13 23:48:19 +02:00
Noah Gorny
7b21a76c6a docs: themes-list: Use gh-pages instead of wiki
Also note that its only most of the themes, not all of them
2020-12-13 23:15:06 +02:00
Ron Green
4dfd8bcc42 feat(git-aliases): add checkout with username (fixes #1712) (#1732)
* feat(git-aliases): add checkout with username

this can be useful for creating a branch with a common prefix

* fix(git-alais): change quotes
2020-12-13 22:58:01 +02:00
Ron Green
a1760af43b feat(vim-alias): add full screen help 2020-12-12 12:51:16 +02:00
egvimo
3019dc331d Add option to append template to existing config (#1723)
* Add option to append template to existing config

* Add test for append-to-config option

Co-authored-by: Egor Moor <egor.moor@edag-ps.com>
2020-12-11 16:32:23 +02:00
Noah Gorny
9b837b4f59 Merge pull request #1708 from seefood/ira/fix-knife-load
Fix knife completion load time (and pre-commit compliance)
2020-12-09 08:44:33 +02:00
Noah Gorny
b4e515f19b Merge pull request #1726 from NoahGorny/delete-travis-settings
ci: Delete travis settings as they no longer support OSS
2020-12-09 08:42:33 +02:00
Noah Gorny
0e6f10f489 docs: Add github action CI badge 2020-12-07 21:38:35 +02:00
Ira Abramov
5a85126241 complete cleanup of the knife completion file 2020-12-07 18:06:27 +02:00
Ira Abramov
6bcabb1503 Merge branch 'master' into ira/fix-knife-load
* master:
  github: Add no-response bot
  Update contribution.rst
  Add cargo completion
  Add completion for pipx. (#1719)
  Add github action to replace travis
  Address some comments.
  Add in_toolbox prompt to powerline themes
  Update atomic.theme.bash
  Add rustup completion to clean_files.txt
  Add rustup completion
  Move README to be under docs/
  docs: Transition md files to support new rtd format
  pre-commit: Exclude docs _build folder
  Add aliases for GIT-SVN (rebase and dcommit)
2020-12-07 17:33:54 +02:00
Noah Gorny
9904857132 Merge pull request #1728 from Bash-it/NoahGorny-patch-1
Update contribution.rst
2020-12-07 09:32:52 +02:00
Noah Gorny
18365035a9 Merge pull request #162 from willybarro/449d6d4fe1d969a5d60ae71db1440221304dfa48
Add aliases for GIT-SVN (rebase and dcommit)
2020-12-07 02:00:31 +02:00
Noah Gorny
b444ac4e54 Merge pull request #1729 from NoahGorny/add-no-reponse-bot
github: Add no-response bot
2020-12-07 01:13:11 +02:00
Noah Gorny
0e904abd0d github: Add no-response bot 2020-12-07 00:50:42 +02:00
Noah Gorny
e873252227 Disable auto-reload in install.sh 2020-12-06 23:55:25 +02:00
Noah Gorny
7dcf4dd186 Update contribution.rst
Now includes relevant change about `clean_files.txt` and improves the part about our coding style
2020-12-06 23:02:16 +02:00
Noah Gorny
7f1aa107d8 ci: Delete travis settings as they no longer support OSS
Very sad indeed
2020-12-06 21:43:59 +02:00
Noah Gorny
d448ea8cf1 Merge pull request #1722 from NoahGorny/migrate-to-github-actions
migrate to github actions
2020-12-06 18:55:27 +02:00
Noah Gorny
d5c2fdc672 Merge pull request #1725 from NariyasuHeseri/cargo-completion
Add cargo completion
2020-12-06 09:28:18 +02:00
Nariyasu Heseri
4d51bfcaf4 Add cargo completion 2020-12-06 15:22:36 +09:00
NariyasuHeseri
4a5ea95e2e Add completion for pipx. (#1719)
* Add completion for pipx.

* Add pipx  completion to clean_files.txt.

* Format pipx.completion.bash to match the project's coding style.

* Format pipx.completion.bash with ./lint_clean_files.sh.
2020-12-05 18:33:50 +02:00
Noah Gorny
8198fafbd9 Add github action to replace travis 2020-12-05 11:28:29 +02:00
Noah Gorny
1702e0217a docs: Remove themes readmes 2020-12-04 17:24:26 +02:00
Noah Gorny
d9364ced7a Merge pull request #1692 from NoahGorny/docs-modify-md-files
docs: Transition md files to support new rtd format
2020-12-04 16:33:09 +02:00
Noah Gorny
929321ad0a Merge pull request #1716 from likan999/in_toolbox
Add in_toolbox prompt to powerline themes
2020-12-03 21:33:55 +02:00
Kan Li
c13850faa2 Address some comments. 2020-11-28 19:07:10 -08:00
Kan Li
8ce9d8daa5 Add in_toolbox prompt to powerline themes
[Toolbox](https://github.com/containers/toolbox) is an containerized
development environment. This commit adds a promot to powerline when it
is running inside a toolbox.
2020-11-28 12:18:13 -08:00
Noah Gorny
13deafbb1b Merge pull request #1715 from lfelipe1501/patch-2
Update atomic.theme.bash
2020-11-26 19:13:04 +02:00
Luis Felipe Sánchez
794f0e321e Update atomic.theme.bash
fixed the space error after hiding the scm
2020-11-26 09:11:08 -05:00
Noah Gorny
63ad4897ef Merge pull request #1711 from NoahGorny/rustup-completion
Add rustup completion
2020-11-20 16:23:58 +02:00
Noah Gorny
b70da511f2 Add rustup completion to clean_files.txt 2020-11-20 13:01:41 +02:00
Noah Gorny
06b1ffecc0 Add rustup completion 2020-11-20 13:01:25 +02:00
Noah Gorny
bd8b8bb21e Merge pull request #1705 from NoahGorny/exclude-build-directory-pre-commit
pre-commit: Exclude docs _build folder
2020-11-14 00:12:49 +02:00
Ira Abramov
d84d6a8356 Add a credit comment 2020-11-08 18:48:29 +02:00
Ira Abramov
f5fe3dbeb0 shell-check fixes 2020-11-08 17:57:54 +02:00
Ira Abramov
689758cf71 pre-commit fixes. 2020-11-08 17:40:45 +02:00
Ira Abramov
889259dfec Cut 30s vrom the knife completion init time. 2020-11-08 17:33:21 +02:00
Noah Gorny
72f5c2ada0 Move README to be under docs/ 2020-11-06 19:16:56 +02:00
Noah Gorny
864970bcd2 docs: Transition md files to support new rtd format 2020-11-06 19:16:56 +02:00
Noah Gorny
5cdb98f802 pre-commit: Exclude docs _build folder 2020-11-06 19:14:19 +02:00
Noah Gorny
621ac92ae1 Migrate wiki docs to rtd format 2020-11-05 20:41:26 +02:00
Noah Gorny
bcc3f4080b Merge pull request #1698 from davidpfarrell/themes/clean-powerline
Clean Powerline; Add Dir Support to Clean_Files
2020-11-05 19:22:29 +02:00
David Farrell
48333b9816 Merge branch 'themes/clean-powerline' of davidpfarrell.github.com:davidpfarrell/bash-it into themes/clean-powerline 2020-11-05 08:31:16 -08:00
David Farrell
75bd5c85c1 Explain Bash-it variable clearing in lint script 2020-11-05 08:30:33 -08:00
David Farrell
ff208775a5 Explain Bash-it variable clearing in lint script 2020-11-05 08:28:33 -08:00
David Farrell
a858e75456 Add Dir Support to Clean_Files; Clean powerline theme 2020-11-03 16:14:02 -08:00
Noah Gorny
52c0f6564e Merge pull request #1701 from davidpfarrell/lint_clean_files
Moves lint logic into lint_clean_files.sh
2020-11-04 01:08:22 +02:00
David Farrell
da9b710014 Moves lint logic into lint_clean_files.sh 2020-11-03 10:10:11 -08:00
Noah Gorny
447448b357 Merge pull request #1700 from davidpfarrell/docs/fix_make_bat
Adds better support for .bat files; Fixes docs/make.bat
2020-11-03 19:44:08 +02:00
David Farrell
9edba505b5 Adds better support for .bat files; Fixes docs/make.bat 2020-11-03 09:16:14 -08:00
Noah Gorny
d5e54596a9 Merge pull request #1688 from NoahGorny/docs
Basic ReadTheDocs
2020-11-02 08:40:56 +02:00
Noah Gorny
600b425e0a Merge pull request #1695 from NoahGorny/clean-90210-theme
Clean 90210 theme
2020-11-01 17:09:29 +02:00
Noah Gorny
a717283163 docs: Add label to git_prompt section 2020-10-31 23:12:31 +02:00
Noah Gorny
0076db0efb docs: Add CI stage 2020-10-31 23:07:02 +02:00
Noah Gorny
3844b652b4 Add readthedocs configuration 2020-10-31 23:07:02 +02:00
Noah Gorny
1228418653 docs: Change theme to sphinx rtd theme 2020-10-31 23:07:02 +02:00
Noah Gorny
f7e295f691 Move most of the documentation to .rst format 2020-10-31 23:07:02 +02:00
Noah Gorny
6abb26c6c6 docs: Add empty _static and _templates directories 2020-10-31 23:07:02 +02:00
Noah Gorny
b667a71995 docs: Add basic sphinx docs 2020-10-31 23:07:02 +02:00
Noah Gorny
3f68817047 Clean 90210 theme 2020-10-31 12:33:12 +02:00
Noah Gorny
af6af2d932 Merge pull request #1687 from NoahGorny/enforce-pre-commit-only-newlines
Enforce pre-commit newline fixes
2020-10-31 12:32:02 +02:00
Noah Gorny
0b9da701c4 Rename lint CI job 2020-10-30 10:17:38 +02:00
Noah Gorny
dd1474990c Modify general editorconfig settings 2020-10-30 10:17:11 +02:00
Noah Gorny
54116fc068 Bump shellcheck, shfmt hooks to 2.1.4 2020-10-29 23:05:23 +02:00
Noah Gorny
1f5d9b757f Fix newline and trailing space issues 2020-10-29 19:57:14 +02:00
Noah Gorny
507e4bec82 Convert files with spaces and tabs to only spaces 2020-10-29 19:57:14 +02:00
Ira Abramov
eca68db8cc Fixing the indent to everyone's content 2020-10-29 19:57:14 +02:00
Ira Abramov
81f7af5036 In case we ARE committing to tabs now... 2020-10-29 19:57:14 +02:00
Ira Abramov
3a1283dad5 Fix EOF 2020-10-29 19:57:14 +02:00
Ira Abramov
c42e3e8b21 Removed trailing whitespaces 2020-10-29 19:57:14 +02:00
Noah Gorny
3f318914fd Merge pull request #1624 from NoahGorny/enforce-pre-commit
Enforce pre commit take 2
2020-10-29 19:55:55 +02:00
Noah Gorny
d150fc6ec1 ci: Run pre-commit only on whitelisted files 2020-10-28 11:51:04 +02:00
Noah Gorny
2acf26b7b3 pre-commit: Do not run shfmt/shellcheck on .bats files 2020-10-28 11:51:04 +02:00
Noah Gorny
45d076567a Add simple shellcheckrc 2020-10-28 11:51:04 +02:00
Noah Gorny
b14a38fec9 ci: Add pre-commit run and remove trailling spaces 2020-10-28 11:51:04 +02:00
Ira Abramov
5045867b2c Don't touch tab indentations, they are there for a good reason 2020-10-28 09:08:04 +02:00
Ira Abramov
d986261f98 another round of refinements after PR #1434 2020-10-28 09:08:04 +02:00
Ira Abramov
250bd2bbd8 Add a note on how to use the pre-commit yaml. 2020-10-28 09:08:04 +02:00
Ira Abramov
9ac6a6ab96 Enforce some coding standards for the contributers 2020-10-28 09:08:04 +02:00
Noah Gorny
e290af4eec Merge pull request #1690 from NoahGorny/bash-it-version-improvement
Improve bash-it version output
2020-10-28 07:33:04 +02:00
Noah Gorny
93cc173815 Merge pull request #1691 from NoahGorny/git-push-delete-alias
git: Add git push --delete alias
2020-10-28 07:32:15 +02:00
Noah Gorny
313abebbb0 git: Add git push --delete alias 2020-10-27 20:06:37 +02:00
Noah Gorny
e023d6f851 Improve bash-it version output
As we now have "stable" releases and "dev" type of versions, `version` command should
provide usefull output on that
2020-10-27 20:01:50 +02:00
Noah Gorny
40d154cb16 Merge pull request #1689 from NoahGorny/rename-bash-it-update-internal
Rename _bash-it_update to _bash-it-update
2020-10-25 21:08:46 +02:00
Noah Gorny
825fc88a8f Rename _bash-it_update to _bash-it-update 2020-10-25 15:24:19 +02:00
Noah Gorny
c7d67aedb9 Merge pull request #1685 from NoahGorny/binary-exists
Add _binary_exists and use in github-cli completion
2020-10-21 11:23:31 +03:00
Noah Gorny
3838f12498 Add tests for _binary_exists 2020-10-21 11:02:55 +03:00
BarbUk
5e65235d0e Theme barbuk - add venv glyph and fix venv display in ssh mode (#1681)
* Add python venv glyph

* Fix venv display (tested for local and ssh prompt)

* Add documentation for python venv
2020-10-21 00:27:48 +03:00
Noah Gorny
8a36f21ca1 Add _binary_exists and use in github-cli completion
gh was also used as an git alias, and caused _command_exists to not fail as expected
2020-10-21 00:14:11 +03:00
Willy Barro
449d6d4fe1 Add aliases for GIT-SVN (rebase and dcommit)
- Add "gsr" for "git svn rebase"
- Add "gsd" for "git svn dcommit"
2012-09-25 17:59:45 -03:00
280 changed files with 11103 additions and 6332 deletions

View File

@@ -5,11 +5,26 @@ indent_style = space
indent_size = 2 indent_size = 2
end_of_line = lf end_of_line = lf
charset = utf-8 charset = utf-8
trim_trailing_whitespace = true trim_trailing_whitespace = true
insert_final_newline = true insert_final_newline = true
[*.md] [**.{md,rst}]
trim_trailing_whitespace = false trim_trailing_whitespace = false
[.git*] [.git*]
indent_style = tab indent_style = tab
[{**.*sh,test/run}]
indent_style = tab
indent_size = 4
shell_variant = bash
binary_next_line = true # like -bn
switch_case_indent = true # like -ci
space_redirects = true # like -sr
keep_padding = false # like -kp
end_of_line = lf
charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = true

7
.gitattributes vendored
View File

@@ -1,2 +1,9 @@
*.sh text eol=lf *.sh text eol=lf
*.bash text eol=lf *.bash text eol=lf
# Docs allow trailing whitespaces
*.md whitespace=-blank-at-eol
*.rst whitespace=-blank-at-eol
# Windows files
*.bat text eol=crlf

46
.github/ISSUE_TEMPLATE/bug_report.md vendored Normal file
View File

@@ -0,0 +1,46 @@
---
name: Bug report
about: Create a bug report to help us improve
title: ''
labels: bug:general
assignees: ''
---
<!--- Provide a general summary of the issue in the Title above -->
## Expected Behavior
<!--- Tell us what should happen -->
## Current Behavior
<!--- Tell us what happens instead of the expected behavior -->
## Possible Solution
<!--- Not obligatory, but suggest a fix/reason for the bug, -->
## Context
<!--- How has this issue affected you? What are you trying to accomplish? -->
<!--- Providing context helps us come up with a solution that is most useful in the real world -->
## Steps to Reproduce
<!--- Provide a link to a live example, or an unambiguous set of steps to -->
<!--- reproduce this bug. Include code to reproduce, if relevant -->
1.
2.
3.
4.
## Your Environment
<!--- Include as many relevant details about the environment you experienced the bug in -->
* Bash-it version used:
* List of enabled plugins, themes and aliases (use ``bash-it show (plugins/themes/aliases)``):
* ``bash-it doctor`` output:
* Bash version:
* Operating System and version:
## Your Bash Config File
<!--- Please paste here your bash config file (.bashrc/.bash_profile) -->
<!--- This will help us debug and locate the problem -->
```bash
# Your bash config file should be here
```

View File

@@ -0,0 +1,23 @@
---
name: Feature request
about: Suggest an idea for this project
title: ''
labels: feature request
assignees: ''
---
<!--- Provide a general summary of the issue in the Title above -->
## Expected Behavior
<!--- Tell us how your feature should work -->
## Current Behavior
<!--- Explain the difference your feature will have from current behavior -->
## Possible Solution
<!--- Not obligatory, but suggest ideas on how to implement the addition or change -->
## Context
<!--- How has this issue affected you? What are you trying to accomplish? -->
<!--- Providing context helps us come up with a solution that is most useful in the real world -->

30
.github/PULL_REQUEST_TEMPLATE.md vendored Normal file
View File

@@ -0,0 +1,30 @@
<!--- Provide a general summary of your changes in the Title above -->
## Description
<!--- Describe your changes in detail -->
## Motivation and Context
<!--- Why is this change required? What problem does it solve? -->
<!--- If it fixes an open issue, please link to the issue here. -->
## How Has This Been Tested?
<!--- Please describe in detail how you tested your changes. -->
<!--- Include details of your testing environment, and the tests you ran to -->
<!--- see how your change affects other areas of the code, etc. -->
## Screenshots (if appropriate):
## Types of changes
<!--- What types of changes does your code introduce? Put an `x` in all the boxes that apply: -->
- [ ] Bug fix (non-breaking change which fixes an issue)
- [ ] New feature (non-breaking change which adds functionality)
- [ ] Breaking change (fix or feature that would cause existing functionality to change)
## Checklist:
<!--- Go over all the following points, and put an `x` in all the boxes that apply. -->
<!--- If you're unsure about any of these, don't hesitate to ask. We're here to help! -->
- [ ] My code follows the code style of this project.
- [ ] If my change requires a change to the documentation, I have updated the documentation accordingly.
- [ ] I have read the **CONTRIBUTING** document.
- [ ] If I have added a new file, I also added it to ``clean_files.txt`` and formatted it using ``lint_clean_files.sh``.
- [ ] I have added tests to cover my changes, and all the new and existing tests pass.

11
.github/no-response.yml vendored Normal file
View File

@@ -0,0 +1,11 @@
# Configuration for probot-no-response - https://github.com/probot/no-response
# Number of days of inactivity before an Issue is closed for lack of response
daysUntilClose: 14
# Label requiring a response
responseRequiredLabel: waiting-for-response
# Comment to post when closing an Issue for lack of response. Set to `false` to disable
closeComment: >
This issue has been automatically closed because there has been no response
to our request for more information from the original author.
You can always reopen the issue if needed.

60
.github/workflows/ci.yml vendored Normal file
View File

@@ -0,0 +1,60 @@
name: CI
# Triggers the workflow on push or pull request events
on:
push:
branches: [ master ]
pull_request:
branches: [ master ]
jobs:
bats-test:
strategy:
matrix:
os: [ubuntu-20.04, ubuntu-18.04, ubuntu-16.04, macos-10.15]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v2
- name: Install greadlink
if: startsWith(runner.os, 'macOS')
run: brew install coreutils
- name: Test code
run: test/run
build-docs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: 3.8
- name: Install docs dependencies
run: python3 -m pip install -r docs/requirements.txt
- name: Build the docs
run: sphinx-build -W -b html docs docs/_build/html
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Set up Go
uses: actions/setup-go@v2
with:
go-version: 1.14
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: 3.8
- name: Install shfmt
run: GO111MODULE=on go get mvdan.cc/sh/v3/cmd/shfmt
- name: Install shellcheck
run: brew install shellcheck
- name: Install pre-commit
run: python3 -m pip install -r test/lint-requirements.txt
- name: Run lint
run: ./lint_clean_files.sh

50
.pre-commit-config.yaml Normal file
View File

@@ -0,0 +1,50 @@
# See https://pre-commit.com for more information
# See https://pre-commit.com/hooks.html for more hooks
---
# fail_fast: true
minimum_pre_commit_version: 1.18.1
exclude: "docs/_build/"
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v2.3.0
hooks:
- id: trailing-whitespace
exclude: ".(md|rst)$"
- id: end-of-file-fixer
- id: check-merge-conflict
- id: mixed-line-ending
- id: check-added-large-files
- repo: https://github.com/jumanjihouse/pre-commit-hooks
rev: 2.1.5
hooks:
- id: git-check # Configure in .gitattributes
- id: shellcheck
exclude: ".bats$"
- id: shfmt
exclude: ".bats$"
- repo: https://github.com/Lucas-C/pre-commit-hooks
rev: v1.1.7
hooks:
# - id: forbid-crlf
- id: remove-crlf
exclude: ".bat$"
- repo: local
hooks:
- id: dot-sh
name: Check .sh files against bash-it requirements
entry: ./hooks/dot-sh.sh
language: system
files: "\\.sh$"
types: [file]
- id: dot-bash
name: Check .bash files against bash-it requirements
exclude: "test/test_helper.bash"
entry: ./hooks/dot-bash.sh
language: system
files: "\\.bash$"
types: [file]
- id: clean-files-txt
name: Check that clean_files.txt is sorted alphabetically.
entry: ./hooks/check-clean-files-txt.sh
language: system
files: clean_files.txt

10
.readthedocs.yml Normal file
View File

@@ -0,0 +1,10 @@
version: 2
sphinx:
builder: htmldir
configuration: docs/conf.py
python:
version: 3.7
install:
- requirements: docs/requirements.txt

6
.shellcheckrc Normal file
View File

@@ -0,0 +1,6 @@
# We use colors and not assigned
disable=SC2154
# Hard to fix
disable=SC2155
# shellcheck is wrong on some
disable=SC2034

View File

@@ -1,31 +0,0 @@
# YAML anchors need to appear first.
# Keys starting with an underscore are the custom ones, refer to
# https://docs.travis-ci.com/user/build-config-yaml#private-keys-as-yaml-anchors-and-aliases-and-external-tooling
_native_job: &native_job
script: |
test/run
language: shell
os: linux
dist: xenial
jobs:
- <<: *native_job
name: Ubuntu 16.04
- <<: *native_job
name: Ubuntu 18.04
dist: bionic
- <<: *native_job
name: MacOS xcode9.4
os: osx
osx_image: xcode9.4 # Default xcode on Travis.
- <<: *native_job
name: MacOS xcode11.5
os: osx
osx_image: xcode11.5 # Latest xcode on Travis.

View File

@@ -1,91 +0,0 @@
# Contribution Guidelines
When contributing a new feature, a bug fix, a new theme, or any other change to Bash-it, please consider the following guidelines.
Most of this is common sense, but please try to stick to the conventions listed here.
## Issues
* When opening a new issue in the issue tracker, please include information about which _Operating System_ you're using, and which version of _Bash_.
* In many cases, it also makes sense to show which Bash-it plugins you are using.
This information can be obtained using `bash-it show plugins`.
* If the issue happens while loading Bash-it, please also include your `~/.bash_profile` or `~/.bashrc` file,
as well as the install location of Bash-it (default should be `~/.bash_it`).
* When reporting a bug or requesting a new feature, consider providing a Pull Request that fixes the issue or can be used as a starting point for the new feature.
Don't be afraid, most things aren't that complex...
## Pull Requests
* Fork the Bash-it repo, create a new feature branch from _master_ and apply your changes there.
Create a _Pull Request_ from your feature branch against Bash-it's _master_ branch.
* Limit each Pull Request to one feature.
Don't bundle multiple features/changes (e.g. a new _Theme_ and a fix to an existing plugin) into a single Pull Request - create one PR for the theme, and a separate PR for the fix.
* For complex changes, try to _squash_ your changes into a single commit before
pushing code. Once you've pushed your code and opened a PR, please refrain
from force-pushing changes to the PR branch remember, Bash-it is a
distributed project and your branch may be in use already.
* When in doubt, open a PR with too many commits. Bash-it is a learning project
for everyone involved. Showing your work provides a great history for folks
to learn what works and what didn't.
## Code Style
* Try to stick to the existing code style. Please don't reformat or change the syntax of existing code simply because you don't like that style.
* Indentation is using spaces, not tabs. Most of the code is indented with 2 spaces, some with 4 spaces. Please try to stick to 2 spaces.
If you're using an editor that supports [EditorConfig](http://EditorConfig.org), the editor should automatically use the settings defined in Bash-it's [.editorconfig file](.editorconfig).
* When creating new functions, please use a dash ("-") to separate the words of the function's name, e.g. `my-new-function`.
Don't use underscores, e.g. `my_new_function`.
* Internal functions that aren't to be used by the end user should start with an underscore, e.g. `_my-new-internal-function`.
* Use the provided meta functions to document your code, e.g. `about-plugin`, `about`, `group`, `param`, `example`.
This will make it easier for other people to use your new functionality.
Take a look at the existing code for an example (e.g. [the base plugin](plugins/available/base.plugin.bash)).
* When adding files, please use the existing file naming conventions, e.g. plugin files need to end in `.plugin.bash`.
This is important for the installation functionality.
* When using the `$BASH_IT` variable, please always enclose it in double quotes to ensure that the code also works when Bash-it is installed in a directory that contains spaces in its name: `for f in "${BASH_IT}/plugins/available"/*.bash ; do echo "$f" ; done`
* Bash-it supports Bash 3.2 and higher. Please don't use features only available in Bash 4, such as associative arrays.
## Unit Tests
When adding features or making changes/fixes, please run our growing unit test suite to ensure that you did not break existing functionality.
The test suite does not cover all aspects of Bash-it, but please run it anyway to verify that you did not introduce any regression issues.
Any code pushed to GitHub as part of a Pull Request will automatically trigger a continuous integration build on [Travis CI](https://travis-ci.org/Bash-it/bash-it), where the test suite is run on both Linux and macOS.
The Pull Request will then show the result of the Travis build, indicating whether all tests ran fine, or whether there were issues.
Please pay attention to this, Pull Requests with build issues will not be merged.
Adding new functionality or changing existing functionality is a good opportunity to increase Bash-it's test coverage.
When you're changing the Bash-it codebase, please consider adding some unit tests that cover the new or changed functionality.
Ideally, when fixing a bug, a matching unit test that verifies that the bug is no longer present, is added at the same time.
To run the test suite, simply execute the following in the directory where you cloned Bash-it:
```bash
test/run
```
This command will ensure that the [Bats Test Framework](https://github.com/bats-core/bats-core) is available in the local `test_lib` directory (Bats is included as a Git submodule) and then run the test suite found in the [test](test) folder.
The test script will execute each test in turn, and will print a status for each test case.
When adding new test cases, please take a look at the existing test cases for examples.
The following libraries are used to help with the tests:
* Test Framework: https://github.com/bats-core/bats-core
* Support library for Bats-Assert: https://github.com/ztombol/bats-support
* General `assert` functions: https://github.com/ztombol/bats-assert
* File `assert` functions: https://github.com/ztombol/bats-file
When verifying test results, please try to use the `assert` functions found in these libraries.
## Features
* When adding new completions or plugins, please don't simply copy existing tools into the Bash-it codebase, try to load/integrate the tools instead.
An example is using `nvm`: Instead of copying the existing `nvm` script into Bash-it, the `nvm.plugin.bash` file tries to load an existing installation of `nvm`.
This means an additional step for the user (installing `nvm` from its own repo, or through a package manager),
but it will also ensure that `nvm` can be upgraded in an easy way.
## Themes
* When adding a new theme, please include a screenshot and a short description about what makes this theme unique in the Pull Request's description field.
Please do not add theme screenshots to the repo itself, as they will add unnecessary bloat to the repo.
The project's Wiki has a _Themes_ page where you can add a screenshot if you want.
* Ideally, each theme's folder should contain a `README.md` file describing the theme and its configuration options.

View File

@@ -1,66 +0,0 @@
# Bash-it Development
This page summarizes a couple of rules to keep in mind when developing features or making changes in Bash-it.
## Debugging and Logging
### General Logging
While developing feature or making changes in general, you can log error/warning/debug
using `_log_error` `_log_warning` and `_log_debug`. This will help you solve problems quicker
and also propagate important notes to other users of Bash-it.
You can see the logs by using `bash-it doctor` command to reload and see the logs.
Alternatively, you can set `BASH_IT_LOG_LEVEL` to `BASH_IT_LOG_LEVEL_ERROR`, `BASH_IT_LOG_LEVEL_WARNING` or `BASH_IT_LOG_LEVEL_ALL`.
### Log Prefix/Context
You can define `BASH_IT_LOG_PREFIX` in your files in order to a have a constant prefix before your logs.
Note that we prefer to uses "tags" based logging, i.e `plugins: git: DEBUG: Loading git plugin`.
## Load Order
### General Load Order
The main `bash_it.sh` script loads the frameworks individual components in the following order:
* `lib/composure.bash`
* Files in `lib` with the exception of `appearance.bash` - this means that `composure.bash` is loaded again here (possible improvement?)
* Enabled `aliases`
* Enabled `plugins`
* Enabled `completions`
* `themes/colors.theme.bash`
* `themes/base.theme.bash`
* `lib/appearance.bash`, which loads the selected theme
* Custom `aliases`
* Custom `plugins`
* Custom `completions`
* Additional custom files from either `$BASH_IT/custom` or `$BASH_IT_CUSTOM`
This order is subject to change.
### Individual Component Load Order
For `aliases`, `plugins` and `completions`, the following rules are applied that influence the load order:
* There is a global `enabled` directory, which the enabled components are linked into. Enabled plugins are symlinked from `$BASH_IT/plugins/available` to `$BASH_IT/enabled` for example. All component types are linked into the same common `$BASH_IT/enabled` directory.
* Within the common `enabled` directories, the files are loaded in alphabetical order, which is based on the item's load priority (see next item).
* When enabling a component, a _load priority_ is assigned to the file. The following default priorities are used:
* Aliases: 150
* Plugins: 250
* Completions: 350
* When symlinking a component into the `enabled` directory, the load priority is used as a prefix for the linked name, separated with three dashes from the name of the component. The `node.plugin.bash` would be symlinked to `250---node.plugin.bash` for example.
* Each file can override the default load priority by specifying a new value. To do this, the file needs to include a comment in the following form. This example would cause the `node.plugin.bash` (if included in that file) to be linked to `225---node.plugin.bash`:
```bash
# BASH_IT_LOAD_PRIORITY: 225
```
Having the order based on a numeric priority in a common directory allows for more flexibility. While in general, aliases are loaded first (since their default priority is 150), it's possible to load some aliases after the plugins, or some plugins after completions by setting the items' load priority. This is more flexible than a fixed type-based order or a strict alphabetical order based on name.
These items are subject to change. When making changes to the internal functionality, this page needs to be updated as well.
## Plugin Disable Callbacks
Plugins can define a function that will be called when the plugin is being disabled.
The callback name should be `{PLUGIN_NAME}_on_disable`, you can see `gitstatus` for usage example.

21
LICENSE Normal file
View File

@@ -0,0 +1,21 @@
MIT License
Copyright (c) 2020-2021 Bash-it
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

502
README.md
View File

@@ -1,502 +0,0 @@
# Bash-it
[![Build Status](https://travis-ci.com/Bash-it/bash-it.svg?branch=master)](https://travis-ci.com/Bash-it/bash-it)
[![Join the chat at https://gitter.im/Bash-it/bash-it](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/Bash-it/bash-it?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
**Bash-it** is a collection of community Bash commands and scripts for Bash 3.2+.
(And a shameless ripoff of [oh-my-zsh](https://github.com/robbyrussell/oh-my-zsh) :smiley:)
Includes autocompletion, themes, aliases, custom functions, a few stolen pieces from Steve Losh, and more.
Bash-it provides a solid framework for using, developing and maintaining shell scripts and custom commands for your daily work.
If you're using the _Bourne Again Shell_ (Bash) regularly and have been looking for an easy way on how to keep all of these nice little scripts and aliases under control, then Bash-it is for you!
Stop polluting your `~/bin` directory and your `.bashrc` file, fork/clone Bash-it and start hacking away.
- [Contributing](#contributing)
- [Installation](#installation)
- [Install Options](#install-options)
- [via Docker](#install-using-docker)
- [Updating](#updating)
- [Help](#help-screens)
- [Search](#search)
- [Syntax](#syntax)
- [Searching with Negations](#searching-with-negations)
- [Using Search to Enable or Disable Components](#using-search-to-enable-or-disable-components)
- [Disabling ASCII Color](#disabling-ascii-color)
- [Custom scripts, aliases, themes, and functions](#custom-scripts-aliases-themes-and-functions)
- [Themes](#themes)
- [Uninstalling](#uninstalling)
- [Misc](#misc)
- [Help Out](#help-out)
- [Contributors](#contributors)
## Contributing
Please take a look at the [Contribution Guidelines](CONTRIBUTING.md) before reporting a bug or providing a new feature.
The [Development Guidelines](DEVELOPMENT.md) have more information on some of the internal workings of Bash-it,
please feel free to read through this page if you're interested in how Bash-it loads its components.
## Installation
1. Check out a clone of this repo to a location of your choice, such as
`git clone --depth=1 https://github.com/Bash-it/bash-it.git ~/.bash_it`
2. Run `~/.bash_it/install.sh` (it automatically backs up your `~/.bash_profile` or `~/.bashrc`, depending on your OS)
3. Edit your modified config (`~/.bash_profile` or `~/.bashrc`) file in order to customize Bash-it.
4. Check out available aliases, completions, and plugins and enable the ones you want to use (see the next section for more details).
### Install Options
The install script can take the following options:
* `--interactive`: Asks the user which aliases, completions and plugins to enable.
* `--silent`: Ask nothing and install using default settings.
* `--no-modify-config`: Do not modify the existing config file (`~/.bash_profile` or `~/.bashrc`).
When run without the `--interactive` switch, Bash-it only enables a sane default set of functionality to keep your shell clean and to avoid issues with missing dependencies.
Feel free to enable the tools you want to use after the installation.
When you run without the `--no-modify-config` switch, the Bash-it installer automatically modifies/replaces your existing config file.
Use the `--no-modify-config` switch to avoid unwanted modifications, e.g. if your Bash config file already contains the code that loads Bash-it.
**NOTE**: Keep in mind how Bash loads its configuration files,
`.bash_profile` for login shells (and in macOS in terminal emulators like [Terminal.app](http://www.apple.com/osx/apps/) or
[iTerm2](https://www.iterm2.com/)) and `.bashrc` for interactive shells (default mode in most of the GNU/Linux terminal emulators),
to ensure that Bash-it is loaded correctly.
A good "practice" is sourcing `.bashrc` into `.bash_profile` to keep things working in all the scenarios.
To achieve this, you can add this snippet in your `.bash_profile`:
```
if [ -f ~/.bashrc ]; then
. ~/.bashrc
fi
```
Refer to the official [Bash documentation](https://www.gnu.org/software/bash/manual/bashref.html#Bash-Startup-Files) to get more info.
### Install using Docker
You can try Bash-it in an isolated environment without changing any local files via a [Docker](https://www.docker.com/) Container.
(Bash Shell v4.4 with Bash-it, [bats](https://github.com/sstephenson/bats),and bash-completion based on [Alpine Linux](https://alpinelinux.org/)).
`docker pull ellerbrock/bash-it`
Have a look at our [bash-it-docker repository](https://github.com/Bash-it/bash-it-docker) for further information.
### Updating
To update Bash-it to the latest stable version, simply run:
```bash
bash-it update stable
```
If you want to update to the latest dev version (directly from master), run:
```bash
bash-it update dev
```
If you want to update automatically and unattended, you can add the optional
`-s/--silent` flag, for example:
```bash
bash-it update dev --silent
```
If you are using an older version of Bash-it, it's possible that some functionality has changed, or that the internal structure of how Bash-it organizes its functionality has been updated.
For these cases, we provide a `migrate` command:
```bash
bash-it migrate
```
This command will automatically migrate the Bash-it structure to the latest version.
The `migrate` command is run automatically if you run the `update`, `enable` or `disable` commands.
## Help Screens
```bash
bash-it show aliases # shows installed and available aliases
bash-it show completions # shows installed and available completions
bash-it show plugins # shows installed and available plugins
bash-it help aliases # shows help for installed aliases
bash-it help completions # shows help for installed completions
bash-it help plugins # shows help for installed plugins
```
## Search
If you need to quickly find out which of the plugins, aliases or completions are available for a specific framework, programming language, or an environment, you can _search_ for multiple terms related to the commands you use frequently.
Search will find and print out modules with the name or description matching the terms provided.
### Syntax
```bash
bash-it search term1 [[-]term2] [[-]term3]....
```
As an example, a ruby developer might want to enable everything related to the commands such as `ruby`, `rake`, `gem`, `bundler`, and `rails`.
Search command helps you find related modules so that you can decide which of them you'd like to use:
```bash
bash-it search ruby rake gem bundle irb rails
aliases: bundler rails
plugins: chruby chruby-auto ruby
completions: bundler gem rake
```
Currently enabled modules will be shown in green.
### Searching with Negations
You can prefix a search term with a "-" to exclude it from the results.
In the above example, if we wanted to hide `chruby` and `chruby-auto`,
we could change the command as follows:
```bash
bash-it search ruby rake gem bundle irb rails -chruby
aliases: bundler rails
plugins: ruby
completions: bundler gem rake
```
### Using Search to Enable or Disable Components
By adding a `--enable` or `--disable` to the search command, you can automatically enable all modules that come up as a result of a search query.
This could be quite handy if you like to enable a bunch of components related to the same topic.
### Disabling ASCII Color
To remove non-printing non-ASCII characters responsible for the coloring of the search output, you can set environment variable `NO_COLOR`.
Enabled components will then be shown with a checkmark:
```bash
NO_COLOR=1 bash-it search ruby rake gem bundle irb rails -chruby
aliases => ✓bundler ✓rails
plugins => ✓ruby
completions => bundler gem rake
```
## Custom scripts, aliases, themes, and functions
For custom scripts, and aliases, just create the following files (they'll be ignored by the git repo):
* `aliases/custom.aliases.bash`
* `completion/custom.completion.bash`
* `lib/custom.bash`
* `plugins/custom.plugins.bash`
* `custom/themes/<custom theme name>/<custom theme name>.theme.bash`
Anything in the custom directory will be ignored, with the exception of `custom/example.bash`.
Alternately, if you would like to keep your custom scripts under version control, you can set `BASH_IT_CUSTOM` in your `~/.bashrc` to another location outside of the `$BASH_IT` folder.
In this case, any `*.bash` file under every directory below `BASH_IT_CUSTOM` folder will be used.
## Themes
There are over 50+ Bash-it themes to pick from in `$BASH_IT/themes`.
The default theme is `bobby`.
Set `BASH_IT_THEME` to the theme name you want, or if you've developed your own custom theme outside of `$BASH_IT/themes`,
point the `BASH_IT_THEME` variable directly to the theme file.
To disable theming completely, leave the variable empty.
Examples:
```bash
# Use the "powerline-multiline" theme
export BASH_IT_THEME="powerline-multiline"
# Use a theme outside of the Bash-it folder
export BASH_IT_THEME="/home/foo/my_theme/my_theme.theme.bash"
# Disable theming
export BASH_IT_THEME=""
```
You can easily preview the themes in your own shell using `BASH_PREVIEW=true bash-it reload`.
If you've created your own custom prompts, we'd love it if you shared them with everyone else! Just submit a Pull Request.
You can see theme screenshots on [wiki/Themes](https://github.com/Bash-it/bash-it/wiki/Themes).
**NOTE**: Bash-it and some themes use UTF-8 characters, so to avoid strange behavior in your terminal, set your locale to `LC_ALL=en_US.UTF-8` or the equivalent to your language if it isn't American English.
## Uninstalling
To uninstall Bash-it, run the `uninstall.sh` script found in the `$BASH_IT` directory:
```
cd $BASH_IT
./uninstall.sh
```
This will restore your previous Bash profile.
After the uninstall script finishes, remove the Bash-it directory from your machine (`rm -rf $BASH_IT`) and start a new shell.
## Misc
### Bash Profile Aliases
Bash-it creates a `reload` alias that makes it convenient to reload
your Bash profile when you make changes.
Additionally, if you export `BASH_IT_AUTOMATIC_RELOAD_AFTER_CONFIG_CHANGE` as a non-null value,
Bash-it will automatically reload itself after activating or deactivating plugins, aliases, or completions.
### Prompt Version Control Check
Bash-it provides prompt themes with the ability to check and display version control information for the current directory.
The information is retrieved for each directory and can slow down the navigation of projects with a large number of files and folders.
Turn version control checking off to prevent slow directory navigation within large projects.
Bash-it provides a flag (`SCM_CHECK`) within the `~/.bash_profile` file that turns off/on version control information checking and display within all themes.
Version control checking is on by default unless explicitly turned off.
Set `SCM_CHECK` to 'false' to **turn off** version control checks for all themes:
* `export SCM_CHECK=false`
Set `SCM_CHECK` to 'true' (the default value) to **turn on** version control checks for all themes:
* `export SCM_CHECK=true`
**NOTE:**
It is possible for themes to ignore the `SCM_CHECK` flag and query specific version control information directly.
For example, themes that use functions like `git_prompt_vars` skip the `SCM_CHECK` flag to retrieve and display git prompt information.
If you turned version control checking off and you still see version control information within your prompt, then functions like `git_prompt_vars` are most likely the reason why.
### Git prompt
Bash-it has some nice features related to Git, continue reading to know more about these features.
### Repository info in the prompt
Bash-it can show some information about Git repositories in the shell prompt: the current branch, tag or commit you are at, how many commits the local branch is ahead or behind from the remote branch, and if you have changes stashed.
Additionally, you can view the status of your working copy and get the count of *staged*, *unstaged* and *untracked* files.
This feature is controlled through the flag `SCM_GIT_SHOW_DETAILS` as follows:
Set `SCM_GIT_SHOW_DETAILS` to 'true' (the default value) to **show** the working copy details in your prompt:
* `export SCM_GIT_SHOW_DETAILS=true`
Set `SCM_GIT_SHOW_DETAILS` to 'false' to **don't show** it:
* `export SCM_GIT_SHOW_DETAILS=false`
**NOTE:** If using `SCM_GIT_SHOW_MINIMAL_INFO=true`, then the value of `SCM_GIT_SHOW_DETAILS` is ignored.
### Remotes and remote branches
In some git workflows, you must work with various remotes, for this reason, Bash-it can provide some useful information about your remotes and your remote branches, for example, the remote on you are working, or if your local branch is tracking a remote branch.
You can control this feature with the flag `SCM_GIT_SHOW_REMOTE_INFO` as follows:
Set `SCM_GIT_SHOW_REMOTE_INFO` to 'auto' (the default value) to activate it only when more than one remote is configured in the current repo:
* `export SCM_GIT_SHOW_REMOTE_INFO=auto`
Set `SCM_GIT_SHOW_REMOTE_INFO` to 'true' to always activate the feature:
* `export SCM_GIT_SHOW_REMOTE_INFO=true`
Set `SCM_GIT_SHOW_REMOTE_INFO` to 'false' to **disable the feature**:
* `export SCM_GIT_SHOW_REMOTE_INFO=false`
**NOTE:** If using `SCM_GIT_SHOW_MINIMAL_INFO=true`, then the value of `SCM_GIT_SHOW_REMOTE_INFO` is ignored.
### Untracked files
By default, the `git status` command shows information about *untracked* files.
This behavior can be controlled through command-line flags or git configuration files.
For big repositories, ignoring *untracked* files can make git faster.
Bash-it uses `git status` to gather the repo information it shows in the prompt, so in some circumstances, it can be useful to instruct Bash-it to ignore these files.
You can control this behavior with the flag `SCM_GIT_IGNORE_UNTRACKED`:
Set `SCM_GIT_IGNORE_UNTRACKED` to 'false' (the default value) to get information about *untracked* files:
* `export SCM_GIT_IGNORE_UNTRACKED=false`
Set `SCM_GIT_IGNORE_UNTRACKED` to 'true' to **ignore** *untracked* files:
* `export SCM_GIT_IGNORE_UNTRACKED=true`
Also, with this flag to false, Bash-it will not show the repository as dirty when the repo has *untracked* files, and will not display the count of *untracked* files.
**NOTE:** If you set in git configuration file the option to ignore *untracked* files, this flag has no effect, and Bash-it will ignore *untracked* files always.
### Stash item count
When `SCM_GIT_SHOW_DETAILS` is enabled, you can get the count of *stashed* items. This feature can be useful when a user has a lot of stash items.
This feature is controlled through the flag `SCM_GIT_SHOW_STASH_INFO` as follows:
Set `SCM_GIT_SHOW_STASH_INFO` to 'true' (the default value) to **show** the count of stashed items:
* `export SCM_GIT_SHOW_STASH_INFO=true`
Set `SCM_GIT_SHOW_STASH_INFO` to 'false' to **don't show** it:
* `export SCM_GIT_SHOW_STASH_INFO=false`
### Ahead/Behind Count
When displaying information regarding whether or not the local branch is ahead or behind its remote counterpart, you can opt to display the number of commits ahead/behind.
This is useful if you only care whether or not you are ahead or behind and do not care how far ahead/behind you are.
Set `SCM_GIT_SHOW_COMMIT_COUNT` to 'true' (the default value) to **show** the count of commits ahead/behind:
* `export SCM_GIT_SHOW_COMMIT_COUNT=true`
Set `SCM_GIT_SHOW_COMMIT_COUNT` to 'false' to **don't show** it:
* `export SCM_GIT_SHOW_COMMIT_COUNT=false`
### Git user
In some environments, it is useful to know the value of the current git user, which is used to mark all new commits.
For example, any organization that uses the practice of pair programming will typically author each commit with [combined names of the two authors](https://github.com/pivotal/git_scripts).
When another pair uses the same pairing station, the authors are changed at the beginning of the session.
To get up and running with this technique, run `gem install pivotal_git_scripts`, and then edit your `~/.pairs` file, according to the specification on the [gem's homepage](https://github.com/pivotal/git_scripts).
After that, you should be able to run `git pair kg as` to set the author to, eg. "Konstantin Gredeskoul and Alex Saxby", assuming they've been added to the `~/.pairs` file.
Please see gem's documentation for more information.
To enable the display of the current pair in the prompt, you must set `SCM_GIT_SHOW_CURRENT_USER` to `true`.
Once set, the `SCM_CURRENT_USER` variable will be automatically populated with the initials of the git author(s).
It will also be included in the default git prompt.
Even if you do not have `git pair` installed, as long as your `user.name` is set, your initials will be computed from your name and shown in the prompt.
You can control the prefix and the suffix of this component using the two variables:
* `export SCM_THEME_CURRENT_USER_PREFFIX=' ☺︎ '`
And
* `export SCM_THEME_CURRENT_USER_SUFFIX=' ☺︎ '`
**NOTE:** If using `SCM_GIT_SHOW_MINIMAL_INFO=true`, then the value of `SCM_GIT_SHOW_CURRENT_USER` is ignored.
### Git show minimal status info
To speed up the prompt while still getting minimal git status information displayed such as the value of `HEAD` and whether there are any dirty objects, you can set:
```
export SCM_GIT_SHOW_MINIMAL_INFO=true
```
### Ignore repo status
When working in repos with a large codebase, Bash-it can slow down your prompt when checking the repo status.
To avoid it, there is an option you can set via Git config to disable checking repo status in Bash-it.
To disable checking the status in the current repo:
```
$ git config --add bash-it.hide-status 1
```
But if you would like to disable it globally, and stop checking the status for all of your repos:
```
$ git config --global --add bash-it.hide-status 1
```
Setting this flag globally has the same effect as `SCM_CHECK=true`, but only for Git repos.
### Speed up git status calculations
As an alternative to ignoring repo status entirely, you can try out the `gitstatus` plugin.
This plugin speeds up all `git status` calculations by up to 10x times!
**NOTE**: You will need to clone `gitstatus` repo from [here](https://github.com/romkatv/gitstatus).
### Pass function renamed to passgen
The Bash-it `pass` function has been renamed to `passgen` in order to avoid a naming conflict with the [pass password manager](https://www.passwordstore.org/).
In order to minimize the impact on users of the legacy Bash-it `pass` function, Bash-it will create the alias `pass` that calls the new `passgen` function if the `pass` password manager command is not found on the `PATH` (default behavior).
This behavior can be overridden with the `BASH_IT_LEGACY_PASS` flag as follows:
Set `BASH_IT_LEGACY_PASS` to 'true' to force Bash-it to always **create** the `pass` alias to `passgen`:
* `export BASH_IT_LEGACY_PASS=true`
Unset `BASH_IT_LEGACY_PASS` to have Bash-it **return to default behavior**:
* `unset BASH_IT_LEGACY_PASS`
### Debugging
If you encounter problems with any part of Bash-it, run the following command:
```bash
bash-it doctor
```
This will reload your bash profile and print out logs of various parts in Bash-it.
Note that this command at default will print all logs, including debug logs.
You can call it like this:
```bash
bash-it doctor [errors/warnings/all]
```
In order to get wanted verbosity.
### Proxy Support
If you are working in a corporate environment where you have to go through a proxy server for internet access,
then you know how painful it is to configure the OS proxy variables in the shell,
especially if you are switching between environments, e.g. office (with proxy) and home (without proxy).
The Bash shell (and many shell tools) use the following variables to define the proxy to use:
* `HTTP_PROXY` (and `http_proxy`): Defines the proxy server for HTTP requests
* `HTTPS_PROXY` (and `https_proxy`): Defines the proxy server for HTTPS requests
* `ALL_PROXY` (and `all_proxy`): Used by some tools for the same purpose as above
* `NO_PROXY` (and `no_proxy`): Comma-separated list of hostnames that don't have to go through the proxy
Bash-it's `proxy` plugin allows to enable and disable these variables with a simple command.
To start using the `proxy` plugin, run the following:
```bash
bash-it enable plugin proxy
```
Bash-it also provides support for enabling/disabling proxy settings for various shell tools.
The following backends are currently supported (in addition to the shell's environment variables): Git, SVN, npm, ssh.
The `proxy` plugin changes the configuration files of these tools to enable or disable the proxy settings.
Bash-it uses the following variables to set the shell's proxy settings when you call `enable-proxy`.
These variables are best defined in a custom script in Bash-it's custom script folder (`$BASH_IT/custom`), e.g. `$BASH_IT/custom/proxy.env.bash`
* `BASH_IT_HTTP_PROXY` and `BASH_IT_HTTPS_PROXY`: Define the proxy URL to be used, e.g. 'http://localhost:1234'
* `BASH_IT_NO_PROXY`: A comma-separated list of proxy exclusions, e.g. `127.0.0.1,localhost`
Once you have defined these variables (and have run `reload` to load the changes), you can use the following commands to enable or disable the proxy settings in your current shell:
* `enable-proxy`: This sets the shell's proxy environment variables and configures proxy support in your SVN, npm, and SSH configuration files.
* `disable-proxy`: This unsets the shell's proxy environment variables and disables proxy support in your SVN, npm, and SSH configuration files.
There are many more proxy commands, e.g. for changing the local Git project's proxy settings.
Run `glossary proxy` to show the available proxy functions with a short description.
## Help out
We think everyone has their own custom scripts accumulated over time.
And so, following in the footsteps of oh-my-zsh, Bash-it is a framework for easily customizing your Bash shell.
Everyone's got a custom toolbox, so let's start making them even better, **as a community!**
Send us a pull request and we'll merge it as long as it looks good.
If you change an existing command, please give an explanation why.
That will help a lot when we merge your changes in.
Please take a look at the [Contribution Guidelines](CONTRIBUTING.md) before reporting a bug or providing a new feature.
Thanks, and happing bashing!
## Contributors
* [List of contributors][contribute]
[contribute]: https://github.com/Bash-it/bash-it/contributors
[pass password manager]: http://www.passwordstore.org/

View File

@@ -1,20 +1,17 @@
# shellcheck shell=bash
cite 'about-alias' cite 'about-alias'
about-alias 'pbcopy and pbpaste shortcuts to linux' about-alias 'xclip shortcuts'
case $OSTYPE in alias pbcopy="xclip -selection clipboard"
linux*) alias pbpaste="xclip -selection clipboard -o"
XCLIP=$(command -v xclip)
[[ $XCLIP ]] && \
alias pbcopy="$XCLIP -selection clipboard" && \
alias pbpaste="$XCLIP -selection clipboard -o"
;;
esac
alias xcpy="xclip -selection clipboard"
alias xpst="xclip -selection clipboard -o"
# to use it just install xclip on your distribution and it would work like: # to use it just install xclip on your distribution and it would work like:
# $ echo "hello" | pbcopy # $ echo "hello" | xcpy
# $ pbpaste # $ xpst
# hello # hello
# very useful for things like: # very useful for things like:
# cat ~/.ssh/id_rsa.pub | pbcopy # cat ~/.ssh/id_rsa.pub | xcpy
# have fun! # have fun!

View File

@@ -0,0 +1,18 @@
# shellcheck shell=bash
cite 'about-alias'
about-alias 'dnf aliases for fedora 22+ distros'
alias dnfl="dnf list" # List packages
alias dnfli="dnf list installed" # List installed packages
alias dnfgl="dnf grouplist" # List package groups
alias dnfmc="dnf makecache" # Generate metadata cache
alias dnfp="dnf info" # Show package information
alias dnfs="dnf search" # Search package
alias dnfu="sudo dnf upgrade" # Upgrade package
alias dnfi="sudo dnf install" # Install package
alias dnfri='sudo dnf reinstall' # Reinstall package
alias dnfgi="sudo dnf groupinstall" # Install package group
alias dnfr="sudo dnf remove" # Remove package
alias dnfgr="sudo dnf groupremove" # Remove package group
alias dnfc="sudo dnf clean all" # Clean cache

View File

@@ -7,3 +7,4 @@ alias dco="docker-compose"
alias dcofresh="docker-compose-fresh" alias dcofresh="docker-compose-fresh"
alias dcol="docker-compose logs -f --tail 100" alias dcol="docker-compose logs -f --tail 100"
alias dcou="docker-compose up" alias dcou="docker-compose up"
alias dcouns="dcou --no-start"

View File

@@ -8,4 +8,3 @@ fi
alias please=fuck alias please=fuck
alias plz=please alias plz=please
alias fucking=sudo alias fucking=sudo

View File

@@ -1,131 +1,207 @@
# shellcheck shell=bash
cite 'about-alias' cite 'about-alias'
about-alias 'common git abbreviations' about-alias 'common git abbreviations'
# Aliases
alias gcl='git clone'
alias ga='git add'
alias grm='git rm'
alias gap='git add -p'
alias gall='git add -A'
alias gf='git fetch --all --prune'
alias gft='git fetch --all --prune --tags'
alias gfv='git fetch --all --prune --verbose'
alias gftv='git fetch --all --prune --tags --verbose'
alias gus='git reset HEAD'
alias gpristine='git reset --hard && git clean -dfx'
alias gclean='git clean -fd'
alias gm="git merge"
alias gmv='git mv'
alias g='git' alias g='git'
alias get='git' alias get='git'
alias gs='git status'
alias gss='git status -s' # add
alias gsu='git submodule update --init --recursive' alias ga='git add'
alias gl='git pull' alias gall='git add -A'
alias gpl='git pull' alias gap='git add -p'
alias glum='git pull upstream master'
alias gpr='git pull --rebase' # branch
alias gpp='git pull && git push' alias gb='git branch'
alias gup='git fetch && git rebase' alias gbD='git branch -D'
alias gp='git push' alias gba='git branch -a'
alias gpo='git push origin HEAD' alias gbd='git branch -d'
alias gpu='git push --set-upstream' alias gbm='git branch -m'
alias gpuo='git push --set-upstream origin' alias gbt='git branch --track'
alias gpuoc='git push --set-upstream origin $(git symbolic-ref --short HEAD)' alias gdel='git branch -D'
alias gpom='git push origin master'
alias gr='git remote' # for-each-ref
alias grv='git remote -v' alias gbc='git for-each-ref --format="%(authorname) %09 %(if)%(HEAD)%(then)*%(else)%(refname:short)%(end) %09 %(creatordate)" refs/remotes/ --sort=authorname DESC' # FROM https://stackoverflow.com/a/58623139/10362396
alias gra='git remote add'
alias grb='git rebase' # commit
alias grm='git rebase master' alias gc='git commit -v'
alias grmi='git rebase master -i' alias gca='git commit -v -a'
alias gcaa='git commit -a --amend -C HEAD' # Add uncommitted and unstaged changes to the last commit
alias gcam='git commit -v -am'
alias gcamd='git commit --amend'
alias gcm='git commit -v -m'
alias gci='git commit --interactive'
alias gcsam='git commit -S -am'
# checkout
alias gcb='git checkout -b'
alias gco='git checkout'
alias gcob='git checkout -b'
alias gcobu='git checkout -b ${USER}/'
alias gcom='git checkout $(get_default_branch)'
alias gcpd='git checkout $(get_default_branch); git pull; git branch -D'
alias gct='git checkout --track'
# clone
alias gcl='git clone'
# clean
alias gclean='git clean -fd'
# cherry-pick
alias gcp='git cherry-pick'
alias gcpx='git cherry-pick -x'
# diff
alias gd='git diff' alias gd='git diff'
alias gds='git diff --staged' alias gds='git diff --staged'
alias gdt='git difftool' alias gdt='git difftool'
alias gdv='git diff -w "$@" | vim -R -'
alias gc='git commit -v' # archive
alias gca='git commit -v -a'
alias gcm='git commit -v -m'
alias gcam="git commit -v -am"
alias gci='git commit --interactive'
alias gcamd='git commit --amend'
alias gb='git branch'
alias gba='git branch -a'
# FROM https://stackoverflow.com/a/58623139/10362396
alias gbc='git for-each-ref --format="%(authorname) %09 %(if)%(HEAD)%(then)*%(else)%(refname:short)%(end) %09 %(creatordate)" refs/remotes/ --sort=authorname DESC'
alias gbt='git branch --track'
alias gbm='git branch -m'
alias gbd='git branch -d'
alias gbD='git branch -D'
alias gcount='git shortlog -sn'
alias gcp='git cherry-pick'
alias gcpx='git cherry-pick -x'
alias gco='git checkout'
alias gcom='git checkout master'
alias gcb='git checkout -b'
alias gcob='git checkout -b'
alias gct='git checkout --track'
alias gcpd='git checkout master; git pull; git branch -D'
alias gexport='git archive --format zip --output' alias gexport='git archive --format zip --output'
alias gdel='git branch -D'
alias gmu='git fetch origin -v; git fetch upstream -v; git merge upstream/master' # fetch
alias gf='git fetch --all --prune'
alias gft='git fetch --all --prune --tags'
alias gftv='git fetch --all --prune --tags --verbose'
alias gfv='git fetch --all --prune --verbose'
alias gmu='git fetch origin -v; git fetch upstream -v; git merge upstream/$(get_default_branch)'
alias gup='git fetch && git rebase'
# log
alias gg='git log --graph --pretty=format:'\''%C(bold)%h%Creset%C(magenta)%d%Creset %s %C(yellow)<%an> %C(cyan)(%cr)%Creset'\'' --abbrev-commit --date=relative'
alias ggf='git log --graph --date=short --pretty=format:'\''%C(auto)%h %Cgreen%an%Creset %Cblue%cd%Creset %C(auto)%d %s'\'''
alias ggs='gg --stat'
alias ggup='git log --branches --not --remotes --no-walk --decorate --oneline' # FROM https://stackoverflow.com/questions/39220870/in-git-list-names-of-branches-with-unpushed-commits
alias gll='git log --graph --pretty=oneline --abbrev-commit' alias gll='git log --graph --pretty=oneline --abbrev-commit'
alias gg="git log --graph --pretty=format:'%C(bold)%h%Creset%C(magenta)%d%Creset %s %C(yellow)<%an> %C(cyan)(%cr)%Creset' --abbrev-commit --date=relative" alias gnew='git log HEAD@{1}..HEAD@{0}' # Show commits since last pull, see http://blogs.atlassian.com/2014/10/advanced-git-aliases/
alias ggf="git log --graph --date=short --pretty=format:'%C(auto)%h %Cgreen%an%Creset %Cblue%cd%Creset %C(auto)%d %s'" alias gwc='git whatchanged'
alias ggs="gg --stat"
alias gsh="git show" # ls-files
alias gsl="git shortlog -sn" alias gu='git ls-files . --exclude-standard --others' # Show untracked files
alias gwc="git whatchanged" alias glsut='gu'
alias gt="git tag" alias glsum='git diff --name-only --diff-filter=U' # Show unmerged (conflicted) files
alias gta="git tag -a"
alias gtd="git tag -d" # gui
alias gtl="git tag -l" alias ggui='git gui'
alias gpatch="git format-patch -1"
# From http://blogs.atlassian.com/2014/10/advanced-git-aliases/ # home
# Show commits since last pull alias ghm='cd "$(git rev-parse --show-toplevel)"' # Git home
alias gnew="git log HEAD@{1}..HEAD@{0}" # appendage to ghm
# Add uncommitted and unstaged changes to the last commit
alias gcaa="git commit -a --amend -C HEAD"
# Rebase with latest remote master
alias gprom="git fetch origin master && git rebase origin/master && git update-ref refs/heads/master origin/master"
alias gpf="git push --force"
alias gpunch="git push --force-with-lease"
alias ggui="git gui"
alias gcsam="git commit -S -am"
# Stash aliases
alias gst="git stash"
alias gstb="git stash branch"
alias gstd="git stash drop"
alias gstl="git stash list"
# Push introduced in git v2.13.2
alias gstpu="git stash push"
alias gstpum="git stash push -m"
# Save deprecated since git v2.16.0
# - aliases now resolve to push
alias gsts="git stash push"
alias gstsm="git stash push -m"
# Alias gstpo added for symmetry with gstpu (push)
# - gstp remains as alias for pop due to long-standing usage
alias gstpo="git stash pop"
alias gstp="git stash pop"
# Switch aliases - Requires git v2.23+
alias gsw="git switch"
alias gswm="git switch master"
alias gswc="git switch --create"
alias gswt="git switch --track"
# Git home
alias ghm='cd "$(git rev-parse --show-toplevel)"'
if ! _command_exists gh; then if ! _command_exists gh; then
alias gh='ghm' alias gh='ghm'
fi fi
# Show untracked files
alias gu='git ls-files . --exclude-standard --others' # merge
alias gm='git merge'
# mv
alias gmv='git mv'
# patch
alias gpatch='git format-patch -1'
# push
alias gp='git push'
alias gpd='git push --delete'
alias gpf='git push --force'
alias gpo='git push origin HEAD'
alias gpom='git push origin $(get_default_branch)'
alias gpu='git push --set-upstream'
alias gpunch='git push --force-with-lease'
alias gpuo='git push --set-upstream origin'
alias gpuoc='git push --set-upstream origin $(git symbolic-ref --short HEAD)'
# pull
alias gl='git pull'
alias glum='git pull upstream $(get_default_branch)'
alias gpl='git pull'
alias gpp='git pull && git push'
alias gpr='git pull --rebase'
# remote
alias gr='git remote'
alias gra='git remote add'
alias grv='git remote -v'
# rm
alias grm='git rm'
# rebase
alias grb='git rebase'
alias grbc='git rebase --continue'
alias grm='git rebase $(get_default_branch)'
alias grmi='git rebase $(get_default_branch) -i'
alias gprom='git fetch origin $(get_default_branch) && git rebase origin/$(get_default_branch) && git update-ref refs/heads/$(get_default_branch) origin/$(get_default_branch)' # Rebase with latest remote
# reset
alias gus='git reset HEAD'
alias gpristine='git reset --hard && git clean -dfx'
# status
alias gs='git status'
alias gss='git status -s'
# shortlog
alias gcount='git shortlog -sn'
alias gsl='git shortlog -sn'
# show
alias gsh='git show'
# svn
alias gsd='git svn dcommit'
alias gsr='git svn rebase' # Git SVN
# stash
alias gst='git stash'
alias gstb='git stash branch'
alias gstd='git stash drop'
alias gstl='git stash list'
alias gstp='git stash pop' # kept due to long-standing usage
alias gstpo='git stash pop' # recommended for it's symmetry with gstpu (push)
## 'stash push' introduced in git v2.13.2
alias gstpu='git stash push'
alias gstpum='git stash push -m'
## 'stash save' deprecated since git v2.16.0, alias is now push
alias gsts='git stash push'
alias gstsm='git stash push -m'
# submodules
alias gsu='git submodule update --init --recursive'
# switch
# these aliases requires git v2.23+
alias gsw='git switch'
alias gswc='git switch --create'
alias gswm='git switch $(get_default_branch)'
alias gswt='git switch --track'
# tag
alias gt='git tag'
alias gta='git tag -a'
alias gtd='git tag -d'
alias gtl='git tag -l'
case $OSTYPE in case $OSTYPE in
darwin*) darwin*)
alias gtls="git tag -l | gsort -V" alias gtls="git tag -l | gsort -V"
;; ;;
*) *)
alias gtls='git tag -l | sort -V' alias gtls='git tag -l | sort -V'
;; ;;
esac esac
# functions
function gdv() {
git diff --ignore-all-space "$@" | vim -R -
}
function get_default_branch() {
if git branch | grep -q main; then
echo main
else
echo master
fi
}

View File

@@ -18,7 +18,7 @@ function _set_pkg_aliases()
alias kcgpan='kubectl get pods --all-namespaces' alias kcgpan='kubectl get pods --all-namespaces'
alias kcgdan='kubectl get deployments --all-namespaces' alias kcgdan='kubectl get deployments --all-namespaces'
# launches a disposable netshoot pod in the k8s cluster # launches a disposable netshoot pod in the k8s cluster
alias kcnetshoot='kubectl run --generator=run-pod/v1 netshoot-$(date +%s) --rm -i --tty --image nicolaka/netshoot -- /bin/bash' alias kcnetshoot='kubectl run netshoot-$(date +%s) --rm -i --tty --image nicolaka/netshoot -- /bin/bash'
fi fi
} }

View File

@@ -6,4 +6,3 @@ alias node-dev='export NODE_ENV=development'
# alias to setup nodejs production environment # alias to setup nodejs production environment
alias node-prod='export NODE_ENV=production' alias node-prod='export NODE_ENV=production'

View File

@@ -22,6 +22,7 @@ alias nud='npm update'
alias nr='npm run' alias nr='npm run'
alias nls='npm list --depth=0 2>/dev/null' alias nls='npm list --depth=0 2>/dev/null'
alias nlsg='npm list -g --depth=0 2>/dev/null' alias nlsg='npm list -g --depth=0 2>/dev/null'
alias nt='npm test'
# npx # npx
alias nx='npx' alias nx='npx'

View File

@@ -7,4 +7,3 @@ alias puplint="puppet-lint *.pp"
alias pupagt="puppet agent -t" alias pupagt="puppet agent -t"
alias pupagtd="puppet agent -t --debug" alias pupagtd="puppet agent -t --debug"
alias pupapp="puppet apply" alias pupapp="puppet apply"

View File

@@ -3,13 +3,20 @@ about-alias 'systemd service'
case $OSTYPE in case $OSTYPE in
linux*) linux*)
# Improve aliases by bringing the common root `sc|scd` + `sre` for action + `u` for user
alias sc='systemctl' alias sc='systemctl'
alias scr='systemctl daemon-reload'
alias scu='systemctl --user' alias scu='systemctl --user'
alias scur='systemctl --user daemon-reload' alias scdr='systemctl daemon-reload'
alias scdru='systemctl --user daemon-reload'
alias scr='systemctl restart'
alias scru='systemctl --user restart'
alias sce='systemctl stop' alias sce='systemctl stop'
alias scue='systemctl --user stop' alias sceu='systemctl --user stop'
alias scs='systemctl start' alias scs='systemctl start'
alias scus='systemctl --user start' alias scsu='systemctl --user start'
# Keeping previous aliases for a non-breaking change.
alias scue='sceu'
alias scus='scsu'
alias scur='scdru'
;; ;;
esac esac

View File

@@ -7,5 +7,4 @@ alias tf='terraform'
alias tfv='terraform validate' alias tfv='terraform validate'
alias tfp='terraform plan' alias tfp='terraform plan'
alias tfa='terraform apply' alias tfa='terraform apply'
alias tfd='terraform destory' alias tfd='terraform destroy'

View File

@@ -13,4 +13,3 @@ alias tgva='terragrunt validate-all'
alias tgpa='terragrunt plan-all' alias tgpa='terragrunt plan-all'
alias tgaa='terragrunt apply-all' alias tgaa='terragrunt apply-all'
alias tgda='terragrunt destroy-all' alias tgda='terragrunt destroy-all'

View File

@@ -1,3 +1,4 @@
# shellcheck shell=bash
cite 'about-alias' cite 'about-alias'
about-alias 'vim abbreviations' about-alias 'vim abbreviations'
@@ -5,15 +6,20 @@ VIM=$(command -v vim)
GVIM=$(command -v gvim) GVIM=$(command -v gvim)
MVIM=$(command -v mvim) MVIM=$(command -v mvim)
[[ -n $VIM ]] && alias v=$VIM if [[ -n $VIM ]]; then
alias v='$VIM'
# open the vim help in fullscreen incorporated from
# https://stackoverflow.com/a/4687513
alias vimh='${VIM} -c ":h | only"'
fi
# open vim in new tab is taken from # open vim in new tab is taken from
# http://stackoverflow.com/questions/936501/let-gvim-always-run-a-single-instancek # http://stackoverflow.com/questions/936501/let-gvim-always-run-a-single-instancek
case $OSTYPE in case $OSTYPE in
darwin*) darwin*)
[[ -n $MVIM ]] && function mvimt { command mvim --remote-tab-silent "$@" || command mvim "$@"; } [[ -n $MVIM ]] && function mvimt { command mvim --remote-tab-silent "$@" || command mvim "$@"; }
;; ;;
*) *)
[[ -n $GVIM ]] && function gvimt { command gvim --remote-tab-silent "$@" || command gvim "$@"; } [[ -n $GVIM ]] && function gvimt { command gvim --remote-tab-silent "$@" || command gvim "$@"; }
;; ;;
esac esac

View File

@@ -3,18 +3,18 @@
BASH_IT_LOG_PREFIX="core: main: " BASH_IT_LOG_PREFIX="core: main: "
# Only set $BASH_IT if it's not already set # Only set $BASH_IT if it's not already set
if [ -z "$BASH_IT" ]; if [ -z "$BASH_IT" ]; then
then # Setting $BASH to maintain backwards compatibility
# Setting $BASH to maintain backwards compatibility export BASH_IT=$BASH
export BASH_IT=$BASH BASH="$(bash -c 'echo $BASH')"
BASH="$(bash -c 'echo $BASH')" export BASH
export BASH BASH_IT_OLD_BASH_SETUP=true
BASH_IT_OLD_BASH_SETUP=true
fi fi
# Load composure first, so we support function metadata # Load composure first, so we support function metadata
# shellcheck source=./lib/composure.bash # shellcheck disable=SC1090
source "${BASH_IT}/lib/composure.bash" source "${BASH_IT}"/vendor/github.com/erichs/composure/composure.sh
# We need to load logging module first as well in order to be able to log # We need to load logging module first as well in order to be able to log
# shellcheck source=./lib/log.bash # shellcheck source=./lib/log.bash
source "${BASH_IT}/lib/log.bash" source "${BASH_IT}/lib/log.bash"
@@ -23,129 +23,136 @@ source "${BASH_IT}/lib/log.bash"
[ -z "$BASH_IT_OLD_BASH_SETUP" ] || _log_warning "BASH_IT variable not initialized, please upgrade your bash-it version and reinstall it!" [ -z "$BASH_IT_OLD_BASH_SETUP" ] || _log_warning "BASH_IT variable not initialized, please upgrade your bash-it version and reinstall it!"
# For backwards compatibility, look in old BASH_THEME location # For backwards compatibility, look in old BASH_THEME location
if [ -z "$BASH_IT_THEME" ]; if [ -z "$BASH_IT_THEME" ]; then
then _log_warning "BASH_IT_THEME variable not initialized, please upgrade your bash-it version and reinstall it!"
_log_warning "BASH_IT_THEME variable not initialized, please upgrade your bash-it version and reinstall it!" export BASH_IT_THEME="$BASH_THEME"
export BASH_IT_THEME="$BASH_THEME"; unset BASH_THEME
unset BASH_THEME;
fi fi
# support 'plumbing' metadata # support 'plumbing' metadata
cite _about _param _example _group _author _version cite _about _param _example _group _author _version
cite about-alias about-plugin about-completion
# libraries, but skip appearance (themes) for now # libraries, but skip appearance (themes) for now
_log_debug "Loading libraries(except appearance)..." _log_debug "Loading libraries(except appearance)..."
LIB="${BASH_IT}/lib/*.bash" LIB="${BASH_IT}/lib/*.bash"
APPEARANCE_LIB="${BASH_IT}/lib/appearance.bash" APPEARANCE_LIB="${BASH_IT}/lib/appearance.bash"
for _bash_it_config_file in $LIB for _bash_it_config_file in $LIB; do
do if [ "$_bash_it_config_file" != "$APPEARANCE_LIB" ]; then
if [ "$_bash_it_config_file" != "$APPEARANCE_LIB" ]; then filename=${_bash_it_config_file##*/}
filename=${_bash_it_config_file##*/} filename=${filename%.bash}
filename=${filename%.bash} BASH_IT_LOG_PREFIX="lib: ${filename}: "
BASH_IT_LOG_PREFIX="lib: ${filename}: " _log_debug "Loading library file..."
_log_debug "Loading library file..." # shellcheck disable=SC1090
# shellcheck disable=SC1090 source "$_bash_it_config_file"
source "$_bash_it_config_file" fi
fi
done done
# Load vendors
BASH_IT_LOG_PREFIX="vendor: "
for _bash_it_vendor_init in "${BASH_IT}"/vendor/init.d/*.bash; do
_log_debug "Loading \"$(basename "${_bash_it_vendor_init}" .bash)\"..."
# shellcheck disable=SC1090
source "${_bash_it_vendor_init}"
done
unset _bash_it_vendor_init
BASH_IT_LOG_PREFIX="core: main: "
# Load the global "enabled" directory # Load the global "enabled" directory
# "family" param is empty so that files get sources in glob order # "family" param is empty so that files get sources in glob order
# shellcheck source=./scripts/reloader.bash # shellcheck source=./scripts/reloader.bash
source "${BASH_IT}/scripts/reloader.bash" source "${BASH_IT}/scripts/reloader.bash"
# Load enabled aliases, completion, plugins # Load enabled aliases, completion, plugins
for file_type in "aliases" "plugins" "completion" for file_type in "aliases" "plugins" "completion"; do
do # shellcheck source=./scripts/reloader.bash
# shellcheck source=./scripts/reloader.bash source "${BASH_IT}/scripts/reloader.bash" "skip" "$file_type"
source "${BASH_IT}/scripts/reloader.bash" "skip" "$file_type"
done done
# Load theme, if a theme was set # Load theme, if a theme was set
if [[ ! -z "${BASH_IT_THEME}" ]]; then if [[ -n "${BASH_IT_THEME}" ]]; then
_log_debug "Loading \"${BASH_IT_THEME}\" theme..." _log_debug "Loading \"${BASH_IT_THEME}\" theme..."
# Load colors and helpers first so they can be used in base theme # Load colors and helpers first so they can be used in base theme
BASH_IT_LOG_PREFIX="themes: colors: " BASH_IT_LOG_PREFIX="themes: colors: "
# shellcheck source=./themes/colors.theme.bash # shellcheck source=./themes/colors.theme.bash
source "${BASH_IT}/themes/colors.theme.bash" source "${BASH_IT}/themes/colors.theme.bash"
BASH_IT_LOG_PREFIX="themes: githelpers: " BASH_IT_LOG_PREFIX="themes: githelpers: "
# shellcheck source=./themes/githelpers.theme.bash # shellcheck source=./themes/githelpers.theme.bash
source "${BASH_IT}/themes/githelpers.theme.bash" source "${BASH_IT}/themes/githelpers.theme.bash"
BASH_IT_LOG_PREFIX="themes: p4helpers: " BASH_IT_LOG_PREFIX="themes: p4helpers: "
# shellcheck source=./themes/p4helpers.theme.bash # shellcheck source=./themes/p4helpers.theme.bash
source "${BASH_IT}/themes/p4helpers.theme.bash" source "${BASH_IT}/themes/p4helpers.theme.bash"
BASH_IT_LOG_PREFIX="themes: base: " BASH_IT_LOG_PREFIX="themes: command_duration: "
# shellcheck source=./themes/base.theme.bash # shellcheck source=./themes/command_duration.theme.bash
source "${BASH_IT}/themes/base.theme.bash" source "${BASH_IT}/themes/command_duration.theme.bash"
BASH_IT_LOG_PREFIX="themes: base: "
# shellcheck source=./themes/base.theme.bash
source "${BASH_IT}/themes/base.theme.bash"
BASH_IT_LOG_PREFIX="lib: appearance: " BASH_IT_LOG_PREFIX="lib: appearance: "
# appearance (themes) now, after all dependencies # appearance (themes) now, after all dependencies
# shellcheck source=./lib/appearance.bash # shellcheck source=./lib/appearance.bash
source "$APPEARANCE_LIB" source "$APPEARANCE_LIB"
fi fi
BASH_IT_LOG_PREFIX="core: main: " BASH_IT_LOG_PREFIX="core: main: "
_log_debug "Loading custom aliases, completion, plugins..." _log_debug "Loading custom aliases, completion, plugins..."
for file_type in "aliases" "completion" "plugins" for file_type in "aliases" "completion" "plugins"; do
do if [ -e "${BASH_IT}/${file_type}/custom.${file_type}.bash" ]; then
if [ -e "${BASH_IT}/${file_type}/custom.${file_type}.bash" ] BASH_IT_LOG_PREFIX="${file_type}: custom: "
then _log_debug "Loading component..."
BASH_IT_LOG_PREFIX="${file_type}: custom: " # shellcheck disable=SC1090
_log_debug "Loading component..." source "${BASH_IT}/${file_type}/custom.${file_type}.bash"
# shellcheck disable=SC1090 fi
source "${BASH_IT}/${file_type}/custom.${file_type}.bash"
fi
done done
# Custom # Custom
BASH_IT_LOG_PREFIX="core: main: " BASH_IT_LOG_PREFIX="core: main: "
_log_debug "Loading general custom files..." _log_debug "Loading general custom files..."
CUSTOM="${BASH_IT_CUSTOM:=${BASH_IT}/custom}/*.bash ${BASH_IT_CUSTOM:=${BASH_IT}/custom}/**/*.bash" CUSTOM="${BASH_IT_CUSTOM:=${BASH_IT}/custom}/*.bash ${BASH_IT_CUSTOM:=${BASH_IT}/custom}/**/*.bash"
for _bash_it_config_file in $CUSTOM for _bash_it_config_file in $CUSTOM; do
do if [ -e "${_bash_it_config_file}" ]; then
if [ -e "${_bash_it_config_file}" ]; then filename=$(basename "${_bash_it_config_file}")
filename=$(basename "${_bash_it_config_file}") filename=${filename%*.bash}
filename=${filename%*.bash} BASH_IT_LOG_PREFIX="custom: $filename: "
BASH_IT_LOG_PREFIX="custom: $filename: " _log_debug "Loading custom file..."
_log_debug "Loading custom file..." # shellcheck disable=SC1090
# shellcheck disable=SC1090 source "$_bash_it_config_file"
source "$_bash_it_config_file" fi
fi
done done
unset _bash_it_config_file unset _bash_it_config_file
if [[ $PROMPT ]]; then if [[ $PROMPT ]]; then
export PS1="\[""$PROMPT""\]" export PS1="\[""$PROMPT""\]"
fi fi
# Adding Support for other OSes # Adding Support for other OSes
PREVIEW="less" PREVIEW="less"
if [ -s /usr/bin/gloobus-preview ]; then if [ -s /usr/bin/gloobus-preview ]; then
PREVIEW="gloobus-preview" PREVIEW="gloobus-preview"
elif [ -s /Applications/Preview.app ]; then elif [ -s /Applications/Preview.app ]; then
# shellcheck disable=SC2034 # shellcheck disable=SC2034
PREVIEW="/Applications/Preview.app" PREVIEW="/Applications/Preview.app"
fi fi
# Load all the Jekyll stuff # Load all the Jekyll stuff
if [ -e "$HOME/.jekyllconfig" ] if [ -e "$HOME/.jekyllconfig" ]; then
then # shellcheck disable=SC1090
# shellcheck disable=SC1090 . "$HOME/.jekyllconfig"
. "$HOME/.jekyllconfig"
fi fi
# BASH_IT_RELOAD_LEGACY is set. # BASH_IT_RELOAD_LEGACY is set.
if ! command -v reload &>/dev/null && [ -n "$BASH_IT_RELOAD_LEGACY" ]; then if ! command -v reload &> /dev/null && [ -n "$BASH_IT_RELOAD_LEGACY" ]; then
case $OSTYPE in case $OSTYPE in
darwin*) darwin*)
alias reload='source ~/.bash_profile' alias reload='source ~/.bash_profile'
;; ;;
*) *)
alias reload='source ~/.bashrc' alias reload='source ~/.bashrc'
;; ;;
esac esac
fi fi
# Disable trap DEBUG on subshells - https://github.com/Bash-it/bash-it/pull/1040 # Disable trap DEBUG on subshells - https://github.com/Bash-it/bash-it/pull/1040

121
clean_files.txt Normal file
View File

@@ -0,0 +1,121 @@
#######################################################################
# Allow-list of files to be lint-checked by CI
#
# Directory Support
# Directory references are allowed within the file, ie:
#
# themes/powerline
#
# All files under the referenced directory will be checked
#
# Checking Files Locally
# You can manually invoke the check via:
#
# lint_clean_files.sh
#
# root directories
#
docs/
hooks/
# root files
#
.gitattributes
bash_it.sh
clean_files.txt
install.sh
lint_clean_files.sh
# aliases
#
aliases/available/dnf.aliases.bash
aliases/available/git.aliases.bash
aliases/available/vim.aliases.bash
# completions
#
completion/available/apm.completion.bash
completion/available/awless.completion.bash
completion/available/brew.completion.bash
completion/available/cargo.completion.bash
completion/available/composer.completion.bash
completion/available/conda.completion.bash
completion/available/consul.completion.bash
completion/available/django.completion.bash
completion/available/dmidecode.completion.bash
completion/available/docker-machine.completion.bash
completion/available/docker.completion.bash
completion/available/gcloud.completion.bash
completion/available/gem.completion.bash
completion/available/github-cli.completion.bash
completion/available/go.completion.bash
completion/available/helm.completion.bash
completion/available/jboss5.completion.bash
completion/available/jboss7.completion.bash
completion/available/jungle.completion.bash
completion/available/knife.completion.bash
completion/available/kontena.completion.bash
completion/available/kubectl.completion.bash
completion/available/lerna.completion.bash
completion/available/minikube.completion.bash
completion/available/ngrok.completion.bash
completion/available/notify-send.completion.bash
completion/available/npm.completion.bash
completion/available/packer.completion.bash
completion/available/pip.completion.bash
completion/available/pip3.completion.bash
completion/available/pipenv.completion.bash
completion/available/pipx.completion.bash
completion/available/rustup.completion.bash
completion/available/sdkman.completion.bash
completion/available/vault.completion.bash
completion/available/vuejs.completion.bash
completion/available/wpscan.completion.bash
# plugins
#
plugins/available/alias-completion.plugin.bash
plugins/available/basher.plugin.bash
plugins/available/cmd-returned-notify.plugin.bash
plugins/available/docker-machine.plugin.bash
plugins/available/git.plugin.bash
plugins/available/go.plugin.bash
plugins/available/goenv.plugin.bash
plugins/available/history-search.plugin.bash
plugins/available/history-substring-search.plugin.bash
plugins/available/history.plugin.bash
plugins/available/xterm.plugin.bash
# tests
#
test/plugins/alias-completion.plugin.bats
test/test_helper.bash
# themes
#
themes/90210
themes/agnoster
themes/atomic
themes/axin
themes/bakke
themes/barbuk
themes/base.theme.bash
themes/binaryanomaly
themes/bira
themes/bobby
themes/bobby-python
themes/brainy
themes/brunton
themes/candy
themes/command_duration.theme.bash
themes/easy
themes/modern
themes/powerline
themes/pure
themes/purity
# vendor init files
#
vendor/.gitattributes
vendor/init.d

View File

@@ -1,56 +1,4 @@
#!/usr/bin/env bash # shellcheck shell=bash
about-completion "apm completion"
# apm-bash-completion is written by Ugur Ozyilmazel # shellcheck disable=SC1090
# repo: https://github.com/vigo/apm-bash-completion source "${BASH_IT}"/vendor/github.com/vigo/apm-bash-completion/apm
__apm(){
local cur prev options apm_command
COMPREPLY=()
cur="${COMP_WORDS[COMP_CWORD]}"
prev="${COMP_WORDS[COMP_CWORD-1]}"
__apm_get_command
if [[ $cur = -* ]]; then
options="--color"
if [[ -z $apm_command ]]; then
options="$options --version --help"
fi
if [[ $apm_command && $apm_command = publish ]]; then
options="--tag --rename"
fi
else
if [[ -z $apm_command || $apm_command = help ]]; then
options="help clean config dedupe deinstall delete dev develop docs erase featured home init install link linked links list ln lns login ls open outdated publish rebuild rebuild-module-cache remove rm search show star starred stars test uninstall unlink unpublish unstar update upgrade view"
fi
if [[ $apm_command && $apm_command = publish ]]; then
options="major minor patch build"
fi
if [[ $apm_command && $apm_command = config ]]; then
options="set get delete list edit"
fi
fi
COMPREPLY=($(compgen -W "$options" -- "$cur"))
}
__apm_get_command() {
local i
for ((i=1; i < $COMP_CWORD; ++i)); do
local arg=${COMP_WORDS[$i]}
case $arg in
[^-]*)
apm_command=$arg
return;;
--version)
apm_command=-
return;;
--help)
apm_command=help
return;;
publish)
apm_command=publish
return;;
config)
apm_command=config
return;;
esac
done
}
complete -F __apm -o bashdefault -o default apm

View File

@@ -1 +1,5 @@
[[ -x "$(which awless)" ]] && source <(awless completion bash) # shellcheck shell=bash
if _command_exists awless; then
# shellcheck disable=SC1090
source <(awless completion bash)
fi

View File

@@ -1,11 +1,13 @@
#!/usr/bin/env bash # shellcheck shell=bash
cite "about-completion"
about-completion "brew completion"
# Load late to make sure `system` completion loads first # Load late to make sure `system` completion loads first
# BASH_IT_LOAD_PRIORITY: 375 # BASH_IT_LOAD_PRIORITY: 375
if [[ "$(uname -s)" != 'Darwin' ]] ; then if [[ "$(uname -s)" != 'Darwin' ]]; then
_log_warning "unsupported operating system - only 'Darwin' is supported" _log_warning "unsupported operating system - only 'Darwin' is supported"
return 0 return 0
fi fi
# Make sure brew is installed # Make sure brew is installed
@@ -13,15 +15,18 @@ _command_exists brew || return 0
BREW_PREFIX=${BREW_PREFIX:-$(brew --prefix)} BREW_PREFIX=${BREW_PREFIX:-$(brew --prefix)}
if [[ -r "$BREW_PREFIX"/etc/bash_completion.d/brew ]] ; then if [[ -r "$BREW_PREFIX"/etc/bash_completion.d/brew ]]; then
source "$BREW_PREFIX"/etc/bash_completion.d/brew # shellcheck disable=1090
source "$BREW_PREFIX"/etc/bash_completion.d/brew
elif [[ -r "$BREW_PREFIX"/Library/Contributions/brew_bash_completion.sh ]] ; then elif [[ -r "$BREW_PREFIX"/Library/Contributions/brew_bash_completion.sh ]]; then
source "$BREW_PREFIX"/Library/Contributions/brew_bash_completion.sh # shellcheck disable=1090
source "$BREW_PREFIX"/Library/Contributions/brew_bash_completion.sh
elif [[ -f "$BREW_PREFIX"/completions/bash/brew ]] ; then elif [[ -f "$BREW_PREFIX"/completions/bash/brew ]]; then
# For the git-clone based installation, see here for more info: # For the git-clone based installation, see here for more info:
# https://github.com/Bash-it/bash-it/issues/1458 # https://github.com/Bash-it/bash-it/issues/1458
# https://docs.brew.sh/Shell-Completion # https://docs.brew.sh/Shell-Completion
source "$BREW_PREFIX"/completions/bash/brew # shellcheck disable=1090
source "$BREW_PREFIX"/completions/bash/brew
fi fi

View File

@@ -1,9 +1,28 @@
#! bash #! bash
# bash completion for the `bundle` command. # bash completion for the `bundle` command.
# #
# Copyright (c) 2011-2017 Daniel Luz <dev at mernen dot com>. # Copyright (c) 2008 Daniel Luz
# Distributed under the MIT license.
# http://mernen.com/projects/completion-ruby # Permission is hereby granted, free of charge, to any person
# obtaining a copy of this software and associated documentation
# files (the "Software"), to deal in the Software without
# restriction, including without limitation the rights to use,
# copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the
# Software is furnished to do so, subject to the following
# conditions:
# The above copyright notice and this permission notice shall be
# included in all copies or substantial portions of the Software.
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
# EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
# OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
# HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
# WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
# OTHER DEALINGS IN THE SOFTWARE.
# #
# To use, source this file on bash: # To use, source this file on bash:
# . completion-bundle # . completion-bundle

View File

@@ -0,0 +1,6 @@
# shellcheck shell=bash
# cargo (Rust package manager) completion
if _binary_exists rustup && _binary_exists cargo; then
eval "$(rustup completions bash cargo)"
fi

View File

@@ -1,133 +1,129 @@
#!/usr/bin/env bash # shellcheck shell=bash
cite "about-completion"
about-completion "composer completion"
_composer() function __composer_completion() {
{ local cur coms opts com
local cur script coms opts com COMPREPLY=()
COMPREPLY=() _get_comp_words_by_ref -n : cur words
_get_comp_words_by_ref -n : cur words
# for an alias, get the real script behind it # lookup for command
if [[ $(type -t ${words[0]}) == "alias" ]]; then for word in "${words[@]:1}"; do
script=$(alias ${words[0]} | sed -E "s/alias ${words[0]}='(.*)'/\1/") if [[ $word != -* ]]; then
else com=$word
script=${words[0]} break
fi fi
done
# lookup for command # completing for an option
for word in ${words[@]:1}; do if [[ ${cur} == --* ]]; then
if [[ $word != -* ]]; then opts="--help --quiet --verbose --version --ansi --no-ansi --no-interaction --profile --no-plugins --working-dir"
com=$word
break
fi
done
# completing for an option case "$com" in
if [[ ${cur} == --* ]] ; then about)
opts="--help --quiet --verbose --version --ansi --no-ansi --no-interaction --profile --no-plugins --working-dir" opts="${opts} "
;;
archive)
opts="${opts} --format --dir --file"
;;
browse)
opts="${opts} --homepage --show"
;;
clear-cache)
opts="${opts} "
;;
config)
opts="${opts} --global --editor --auth --unset --list --file --absolute"
;;
create-project)
opts="${opts} --stability --prefer-source --prefer-dist --repository --repository-url --dev --no-dev --no-custom-installers --no-scripts --no-progress --no-secure-http --keep-vcs --no-install --ignore-platform-reqs"
;;
depends)
opts="${opts} --recursive --tree"
;;
diagnose)
opts="${opts} "
;;
dump-autoload)
opts="${opts} --no-scripts --optimize --classmap-authoritative --apcu --no-dev"
;;
exec)
opts="${opts} --list"
;;
global)
opts="${opts} "
;;
help)
opts="${opts} --xml --format --raw"
;;
init)
opts="${opts} --name --description --author --type --homepage --require --require-dev --stability --license --repository"
;;
install)
opts="${opts} --prefer-source --prefer-dist --dry-run --dev --no-dev --no-custom-installers --no-autoloader --no-scripts --no-progress --no-suggest --optimize-autoloader --classmap-authoritative --apcu-autoloader --ignore-platform-reqs"
;;
licenses)
opts="${opts} --format --no-dev"
;;
list)
opts="${opts} --xml --raw --format"
;;
outdated)
opts="${opts} --outdated --all --direct --strict"
;;
prohibits)
opts="${opts} --recursive --tree"
;;
remove)
opts="${opts} --dev --no-progress --no-update --no-scripts --update-no-dev --update-with-dependencies --no-update-with-dependencies --ignore-platform-reqs --optimize-autoloader --classmap-authoritative --apcu-autoloader"
;;
require)
opts="${opts} --dev --prefer-source --prefer-dist --no-progress --no-suggest --no-update --no-scripts --update-no-dev --update-with-dependencies --ignore-platform-reqs --prefer-stable --prefer-lowest --sort-packages --optimize-autoloader --classmap-authoritative --apcu-autoloader"
;;
run-script)
opts="${opts} --timeout --dev --no-dev --list"
;;
search)
opts="${opts} --only-name --type"
;;
self-update)
opts="${opts} --rollback --clean-backups --no-progress --update-keys --stable --preview --snapshot"
;;
show)
opts="${opts} --all --installed --platform --available --self --name-only --path --tree --latest --outdated --minor-only --direct --strict"
;;
status)
opts="${opts} "
;;
suggests)
opts="${opts} --by-package --by-suggestion --no-dev"
;;
update)
opts="${opts} --prefer-source --prefer-dist --dry-run --dev --no-dev --lock --no-custom-installers --no-autoloader --no-scripts --no-progress --no-suggest --with-dependencies --optimize-autoloader --classmap-authoritative --apcu-autoloader --ignore-platform-reqs --prefer-stable --prefer-lowest --interactive --root-reqs"
;;
validate)
opts="${opts} --no-check-all --no-check-lock --no-check-publish --with-dependencies --strict"
;;
case "$com" in esac
about)
opts="${opts} "
;;
archive)
opts="${opts} --format --dir --file"
;;
browse)
opts="${opts} --homepage --show"
;;
clear-cache)
opts="${opts} "
;;
config)
opts="${opts} --global --editor --auth --unset --list --file --absolute"
;;
create-project)
opts="${opts} --stability --prefer-source --prefer-dist --repository --repository-url --dev --no-dev --no-custom-installers --no-scripts --no-progress --no-secure-http --keep-vcs --no-install --ignore-platform-reqs"
;;
depends)
opts="${opts} --recursive --tree"
;;
diagnose)
opts="${opts} "
;;
dump-autoload)
opts="${opts} --no-scripts --optimize --classmap-authoritative --apcu --no-dev"
;;
exec)
opts="${opts} --list"
;;
global)
opts="${opts} "
;;
help)
opts="${opts} --xml --format --raw"
;;
init)
opts="${opts} --name --description --author --type --homepage --require --require-dev --stability --license --repository"
;;
install)
opts="${opts} --prefer-source --prefer-dist --dry-run --dev --no-dev --no-custom-installers --no-autoloader --no-scripts --no-progress --no-suggest --optimize-autoloader --classmap-authoritative --apcu-autoloader --ignore-platform-reqs"
;;
licenses)
opts="${opts} --format --no-dev"
;;
list)
opts="${opts} --xml --raw --format"
;;
outdated)
opts="${opts} --outdated --all --direct --strict"
;;
prohibits)
opts="${opts} --recursive --tree"
;;
remove)
opts="${opts} --dev --no-progress --no-update --no-scripts --update-no-dev --update-with-dependencies --no-update-with-dependencies --ignore-platform-reqs --optimize-autoloader --classmap-authoritative --apcu-autoloader"
;;
require)
opts="${opts} --dev --prefer-source --prefer-dist --no-progress --no-suggest --no-update --no-scripts --update-no-dev --update-with-dependencies --ignore-platform-reqs --prefer-stable --prefer-lowest --sort-packages --optimize-autoloader --classmap-authoritative --apcu-autoloader"
;;
run-script)
opts="${opts} --timeout --dev --no-dev --list"
;;
search)
opts="${opts} --only-name --type"
;;
self-update)
opts="${opts} --rollback --clean-backups --no-progress --update-keys --stable --preview --snapshot"
;;
show)
opts="${opts} --all --installed --platform --available --self --name-only --path --tree --latest --outdated --minor-only --direct --strict"
;;
status)
opts="${opts} "
;;
suggests)
opts="${opts} --by-package --by-suggestion --no-dev"
;;
update)
opts="${opts} --prefer-source --prefer-dist --dry-run --dev --no-dev --lock --no-custom-installers --no-autoloader --no-scripts --no-progress --no-suggest --with-dependencies --optimize-autoloader --classmap-authoritative --apcu-autoloader --ignore-platform-reqs --prefer-stable --prefer-lowest --interactive --root-reqs"
;;
validate)
opts="${opts} --no-check-all --no-check-lock --no-check-publish --with-dependencies --strict"
;;
esac # shellcheck disable=SC2207
COMPREPLY=($(compgen -W "${opts}" -- "${cur}"))
__ltrim_colon_completions "$cur"
COMPREPLY=($(compgen -W "${opts}" -- ${cur})) return 0
__ltrim_colon_completions "$cur" fi
return 0; # completing for a command
fi if [[ "$cur" == "$com" ]]; then
coms="about archive browse clear-cache config create-project depends diagnose dump-autoload exec global help init install licenses list outdated prohibits remove require run-script search self-update show status suggests update validate"
# completing for a command # shellcheck disable=SC2207
if [[ $cur == $com ]]; then COMPREPLY=($(compgen -W "${coms}" -- "${cur}"))
coms="about archive browse clear-cache config create-project depends diagnose dump-autoload exec global help init install licenses list outdated prohibits remove require run-script search self-update show status suggests update validate" __ltrim_colon_completions "$cur"
COMPREPLY=($(compgen -W "${coms}" -- ${cur})) return 0
__ltrim_colon_completions "$cur" fi
return 0
fi
} }
complete -o default -F _composer composer complete -o default -F __composer_completion composer

View File

@@ -1,4 +1,11 @@
#!/usr/bin/env bash # shellcheck shell=bash
which register-python-argcomplete > /dev/null \ cite "about-completion"
&& eval "$(register-python-argcomplete conda)" \ about-completion "conda completion"
|| echo "Please install argcomplete to use conda completion"
if _command_exists conda; then
if _command_exists register-python-argcomplete; then
eval "$(register-python-argcomplete conda)"
else
_log_warning "Argcomplete not found. Please run 'conda install argcomplete'"
fi
fi

View File

@@ -1,10 +1,7 @@
# bash completion support for Hashicorp consul # shellcheck shell=bash
cite "about-completion"
about-completion "Hashicorp consul completion"
CONSUL_BIN=$(command -v consul 2>/dev/null) if _command_exists consul; then
complete -C "$(which consul)" consul
if [[ -x "$CONSUL_BIN" ]]
then
complete -C "$CONSUL_BIN" consul
fi fi
unset CONSUL_BIN

View File

@@ -1,72 +1,4 @@
# ######################################################################### # shellcheck shell=bash
# This bash script adds tab-completion feature to django-admin.py and about-completion "django completion"
# manage.py. # shellcheck disable=SC1090
# source "${BASH_IT}"/vendor/github.com/django/django/extras/django_bash_completion
# Testing it out without installing
# =================================
#
# To test out the completion without "installing" this, just run this file
# directly, like so:
#
# . ~/path/to/django_bash_completion
#
# Note: There's a dot ('.') at the beginning of that command.
#
# After you do that, tab completion will immediately be made available in your
# current Bash shell. But it won't be available next time you log in.
#
# Installing
# ==========
#
# To install this, point to this file from your .bash_profile, like so:
#
# . ~/path/to/django_bash_completion
#
# Do the same in your .bashrc if .bashrc doesn't invoke .bash_profile.
#
# Settings will take effect the next time you log in.
#
# Uninstalling
# ============
#
# To uninstall, just remove the line from your .bash_profile and .bashrc.
_django_completion()
{
COMPREPLY=( $( COMP_WORDS="${COMP_WORDS[*]}" \
COMP_CWORD=$COMP_CWORD \
DJANGO_AUTO_COMPLETE=1 $1 ) )
}
complete -F _django_completion -o default django-admin.py manage.py django-admin
_python_django_completion()
{
if [[ ${COMP_CWORD} -ge 2 ]]; then
PYTHON_EXE=$( basename -- ${COMP_WORDS[0]} )
echo $PYTHON_EXE | egrep "python([2-9]\.[0-9])?" >/dev/null 2>&1
if [[ $? == 0 ]]; then
PYTHON_SCRIPT=$( basename -- ${COMP_WORDS[1]} )
echo $PYTHON_SCRIPT | egrep "manage\.py|django-admin(\.py)?" >/dev/null 2>&1
if [[ $? == 0 ]]; then
COMPREPLY=( $( COMP_WORDS="${COMP_WORDS[*]:1}" \
COMP_CWORD=$(( COMP_CWORD-1 )) \
DJANGO_AUTO_COMPLETE=1 ${COMP_WORDS[*]} ) )
fi
fi
fi
}
# Support for multiple interpreters.
unset pythons
if command -v whereis &>/dev/null; then
python_interpreters=$(whereis python | cut -d " " -f 2-)
for python in $python_interpreters; do
pythons="${pythons} $(basename -- $python)"
done
pythons=$(echo $pythons | tr " " "\n" | sort -u | tr "\n" " ")
else
pythons=python
fi
complete -F _python_django_completion -o default $pythons

View File

@@ -0,0 +1,20 @@
# shellcheck shell=bash
function __dmidecode_completion() {
local prev=$(_get_pword)
local curr=$(_get_cword)
case $prev in
-s | --string | -t | --type)
OPTS=$(dmidecode "$prev" 2>&1 | grep -E '^ ' | sed 's/ *//g')
# shellcheck disable=SC2207
COMPREPLY=($(compgen -W "$OPTS" -- "$curr"))
;;
dmidecode)
# shellcheck disable=SC2207
COMPREPLY=($(compgen -W "-d --dev-mem -h --help -q --quiet -s --string -t --type -H --handle -u --dump{,-bin} --from-dump --no-sysfs --oem-string -V --version" -- "$curr"))
;;
esac
}
complete -F __dmidecode_completion dmidecode

View File

@@ -1,5 +1,20 @@
#!/bin/bash #!/bin/bash
# #
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
# Copyright (c) 2014 Docker, Inc
# bash completion for docker-compose # bash completion for docker-compose
# #
# This work is based on the completion for the docker command. # This work is based on the completion for the docker command.
@@ -670,4 +685,4 @@ _docker_compose() {
eval "$__docker_compose_previous_extglob_setting" eval "$__docker_compose_previous_extglob_setting"
unset __docker_compose_previous_extglob_setting unset __docker_compose_previous_extglob_setting
complete -F _docker_compose docker-compose docker-compose.exe complete -F _docker_compose docker-compose docker-compose.exe

View File

@@ -1,416 +1,3 @@
# # shellcheck shell=bash
# bash completion file for docker-machine commands _log_warning '"docker-machine" is now deprecated, and as such the bash completion for it is also deprecated.
# Please disable this completion.'
# This script provides completion of:
# - commands and their options
# - machine names
# - filepaths
#
# To enable the completions either:
# - place this file in /etc/bash_completion.d
# or
# - copy this file to e.g. ~/.docker-machine-completion.sh and add the line
# below to your .bashrc after bash completion features are loaded
# . ~/.docker-machine-completion.sh
#
# --- helper functions -------------------------------------------------------
_docker_machine_q() {
docker-machine 2>/dev/null "$@"
}
# suppresses trailing whitespace
_docker_machine_nospace() {
# compopt is not available in ancient bash versions (OSX)
# so only call it if it's available
type compopt &>/dev/null && compopt -o nospace
}
_docker_machine_machines() {
_docker_machine_q ls --format '{{.Name}}' "$@"
}
_docker_machine_drivers() {
local drivers=(
amazonec2
azure
digitalocean
exoscale
generic
google
hyperv
openstack
rackspace
softlayer
virtualbox
vmwarefusion
vmwarevcloudair
vmwarevsphere
)
echo "${drivers[@]}"
}
_docker_machine_value_of_option() {
local pattern="$1"
for (( i=2; i < ${cword}; ++i)); do
if [[ ${words[$i]} =~ ^($pattern)$ ]] ; then
echo ${words[$i + 1]}
break
fi
done
}
# Returns `key` if we are currently completing the value of a map option
# (`key=value`) which matches the glob passed in as an argument.
# This function is needed for key-specific argument completions.
_docker_machine_map_key_of_current_option() {
local glob="$1"
local key glob_pos
if [ "$cur" = "=" ] ; then # key= case
key="$prev"
glob_pos=$((cword - 2))
elif [[ $cur == *=* ]] ; then # key=value case (OSX)
key=${cur%=*}
glob_pos=$((cword - 1))
elif [ "$prev" = "=" ] ; then
key=${words[$cword - 2]} # key=value case
glob_pos=$((cword - 3))
else
return
fi
[ "${words[$glob_pos]}" = "=" ] && ((glob_pos--)) # --option=key=value syntax
[[ ${words[$glob_pos]} == $glob ]] && echo "$key"
}
# Finds the position of the first word that is neither option nor an option's argument.
# If there are options that require arguments, you need to pass a glob describing
# those options, e.g. "--option1|-o|--option2".
# Use this function to restrict completions to exact positions after the options.
_docker_machine_pos_first_nonflag() {
local argument_flags=$1
local counter=$((${subcommand_pos:-${command_pos}} + 1))
while [ "$counter" -le "$cword" ]; do
if [ -n "$argument_flags" ] && eval "case '${words[$counter]}' in $argument_flags) true ;; *) false ;; esac"; then
(( counter++ ))
# eat "=" in case of --option=arg syntax
[ "${words[$counter]}" = "=" ] && (( counter++ ))
else
case "${words[$counter]}" in
-*)
;;
*)
break
;;
esac
fi
# Bash splits words at "=", retaining "=" as a word, examples:
# "--debug=false" => 3 words, "--log-opt syslog-facility=daemon" => 4 words
while [ "${words[$counter + 1]}" = "=" ] ; do
counter=$(( counter + 2))
done
(( counter++ ))
done
echo $counter
}
# --- completion functions ---------------------------------------------------
_docker_machine_active() {
case "${prev}" in
--timeout|-t)
return
;;
esac
if [[ "${cur}" == -* ]]; then
COMPREPLY=($(compgen -W "--help --timeout -t" -- "${cur}"))
fi
}
_docker_machine_config() {
if [[ "${cur}" == -* ]]; then
COMPREPLY=($(compgen -W "--help --swarm" -- "${cur}"))
else
COMPREPLY=($(compgen -W "$(_docker_machine_machines)" -- "${cur}"))
fi
}
_docker_machine_create() {
case "${prev}" in
--driver|-d)
COMPREPLY=($(compgen -W "$(_docker_machine_drivers)" -- "${cur}"))
return
;;
esac
# driver specific options are only included in help output if --driver is given,
# so we have to pass that option when calling docker-machine to harvest options.
local driver="$(_docker_machine_value_of_option '--driver|-d')"
local parsed_options="$(_docker_machine_q create ${driver:+--driver $driver} --help | grep '^ -' | sed 's/^ //; s/[^a-z0-9-].*$//')"
if [[ ${cur} == -* ]]; then
COMPREPLY=($(compgen -W "${parsed_options} -d --help" -- "${cur}"))
fi
}
_docker_machine_env() {
case "${prev}" in
--shell)
COMPREPLY=($(compgen -W "cmd emacs fish powershell tcsh" -- "${cur}"))
return
;;
esac
if [[ "${cur}" == -* ]]; then
COMPREPLY=($(compgen -W "--help --no-proxy --shell --swarm --unset -u" -- "${cur}"))
else
COMPREPLY=($(compgen -W "$(_docker_machine_machines)" -- "${cur}"))
fi
}
# See docker-machine-wrapper.bash for the use command
_docker_machine_use() {
if [[ "${cur}" == -* ]]; then
COMPREPLY=($(compgen -W "--help --swarm --unset" -- "${cur}"))
else
COMPREPLY=($(compgen -W "$(_docker_machine_machines)" -- "${cur}"))
fi
}
_docker_machine_inspect() {
case "${prev}" in
--format|-f)
return
;;
esac
if [[ "${cur}" == -* ]]; then
COMPREPLY=($(compgen -W "--format -f --help" -- "${cur}"))
else
COMPREPLY=($(compgen -W "$(_docker_machine_machines)" -- "${cur}"))
fi
}
_docker_machine_ip() {
if [[ "${cur}" == -* ]]; then
COMPREPLY=($(compgen -W "--help" -- "${cur}"))
else
COMPREPLY=($(compgen -W "$(_docker_machine_machines)" -- "${cur}"))
fi
}
_docker_machine_kill() {
if [[ "${cur}" == -* ]]; then
COMPREPLY=($(compgen -W "--help" -- "${cur}"))
else
COMPREPLY=($(compgen -W "$(_docker_machine_machines)" -- "${cur}"))
fi
}
_docker_machine_ls() {
local key=$(_docker_machine_map_key_of_current_option '--filter')
case "$key" in
driver)
COMPREPLY=($(compgen -W "$(_docker_machine_drivers)" -- "${cur##*=}"))
return
;;
state)
COMPREPLY=($(compgen -W "Error Paused Running Saved Starting Stopped Stopping" -- "${cur##*=}"))
return
;;
esac
case "${prev}" in
--filter)
COMPREPLY=($(compgen -W "driver label name state swarm" -S= -- "${cur}"))
_docker_machine_nospace
return
;;
--format|-f|--timeout|-t)
return
;;
esac
if [[ "${cur}" == -* ]]; then
COMPREPLY=($(compgen -W "--filter --format -f --help --quiet -q --timeout -t" -- "${cur}"))
fi
}
_docker_machine_mount() {
if [[ "${cur}" == -* ]]; then
COMPREPLY=($(compgen -W "--help --unmount -u" -- "${cur}"))
else
local pos=$(_docker_machine_pos_first_nonflag)
if [ "$cword" -eq "$pos" ]; then
# We can't complete remote filesystems. All we can do here is to complete the machine.
COMPREPLY=($(compgen -W "$(_docker_machine_machines --filter state=Running)" -S: -- "${cur}"))
_docker_machine_nospace
elif [ "$cword" -eq "$((pos + 1))" ]; then
_filedir -d
fi
fi
}
_docker_machine_provision() {
if [[ "${cur}" == -* ]]; then
COMPREPLY=($(compgen -W "--help" -- "${cur}"))
else
COMPREPLY=($(compgen -W "$(_docker_machine_machines --filter state=Running)" -- "${cur}"))
fi
}
_docker_machine_regenerate_certs() {
if [[ "${cur}" == -* ]]; then
COMPREPLY=($(compgen -W "--client-certs --force -f --help" -- "${cur}"))
else
COMPREPLY=($(compgen -W "$(_docker_machine_machines --filter state=Running)" -- "${cur}"))
fi
}
_docker_machine_restart() {
if [[ "${cur}" == -* ]]; then
COMPREPLY=($(compgen -W "--help" -- "${cur}"))
else
COMPREPLY=($(compgen -W "$(_docker_machine_machines)" -- "${cur}"))
fi
}
_docker_machine_rm() {
if [[ "${cur}" == -* ]]; then
COMPREPLY=($(compgen -W "--force -f --help -y" -- "${cur}"))
else
COMPREPLY=($(compgen -W "$(_docker_machine_machines)" -- "${cur}"))
fi
}
_docker_machine_ssh() {
if [[ "${cur}" == -* ]]; then
COMPREPLY=($(compgen -W "--help" -- "${cur}"))
else
COMPREPLY=($(compgen -W "$(_docker_machine_machines)" -- "${cur}"))
fi
}
_docker_machine_scp() {
if [[ "${cur}" == -* ]]; then
COMPREPLY=($(compgen -W "--delta -d --help --quiet -q --recursive -r" -- "${cur}"))
else
_filedir
# It would be really nice to ssh to the machine and ls to complete
# remote files.
COMPREPLY=($(compgen -W "$(_docker_machine_machines | sed 's/$/:/')" -- "${cur}") "${COMPREPLY[@]}")
fi
}
_docker_machine_start() {
if [[ "${cur}" == -* ]]; then
COMPREPLY=($(compgen -W "--help" -- "${cur}"))
else
COMPREPLY=($(compgen -W "$(_docker_machine_machines --filter state=Stopped)" -- "${cur}"))
fi
}
_docker_machine_status() {
if [[ "${cur}" == -* ]]; then
COMPREPLY=($(compgen -W "--help" -- "${cur}"))
else
COMPREPLY=($(compgen -W "$(_docker_machine_machines)" -- "${cur}"))
fi
}
_docker_machine_stop() {
if [[ "${cur}" == -* ]]; then
COMPREPLY=($(compgen -W "--help" -- "${cur}"))
else
COMPREPLY=($(compgen -W "$(_docker_machine_machines --filter state=Running)" -- "${cur}"))
fi
}
_docker_machine_upgrade() {
if [[ "${cur}" == -* ]]; then
COMPREPLY=($(compgen -W "--help" -- "${cur}"))
else
COMPREPLY=($(compgen -W "$(_docker_machine_machines)" -- "${cur}"))
fi
}
_docker_machine_url() {
if [[ "${cur}" == -* ]]; then
COMPREPLY=($(compgen -W "--help" -- "${cur}"))
else
COMPREPLY=($(compgen -W "$(_docker_machine_machines)" -- "${cur}"))
fi
}
_docker_machine_version() {
if [[ "${cur}" == -* ]]; then
COMPREPLY=($(compgen -W "--help" -- "${cur}"))
else
COMPREPLY=($(compgen -W "$(_docker_machine_machines)" -- "${cur}"))
fi
}
_docker_machine_help() {
if [[ "${cur}" == -* ]]; then
COMPREPLY=($(compgen -W "--help" -- "${cur}"))
else
COMPREPLY=($(compgen -W "${commands[*]}" -- "${cur}"))
fi
}
_docker_machine_docker_machine() {
if [[ " ${wants_file[*]} " =~ " ${prev} " ]]; then
_filedir
elif [[ " ${wants_dir[*]} " =~ " ${prev} " ]]; then
_filedir -d
elif [[ "${cur}" == -* ]]; then
COMPREPLY=($(compgen -W "${flags[*]} ${wants_dir[*]} ${wants_file[*]}" -- "${cur}"))
else
COMPREPLY=($(compgen -W "${commands[*]}" -- "${cur}"))
fi
}
_docker_machine() {
COMPREPLY=()
local commands=(active config create env inspect ip kill ls mount provision regenerate-certs restart rm ssh scp start status stop upgrade url version help)
local flags=(--debug --native-ssh --github-api-token --bugsnag-api-token --help --version)
local wants_dir=(--storage-path)
local wants_file=(--tls-ca-cert --tls-ca-key --tls-client-cert --tls-client-key)
# Add the use subcommand, if we have an alias loaded
if [[ ${DOCKER_MACHINE_WRAPPED} = true ]]; then
commands=("${commands[@]}" use)
fi
local cur prev words cword
_get_comp_words_by_ref -n : cur prev words cword
local i
local command=docker-machine command_pos=0
for (( i=1; i < ${cword}; ++i)); do
local word=${words[i]}
if [[ " ${wants_file[*]} ${wants_dir[*]} " =~ " ${word} " ]]; then
# skip the next option
(( ++i ))
elif [[ " ${commands[*]} " =~ " ${word} " ]]; then
command=${word}
command_pos=$i
fi
done
local completion_func=_docker_machine_"${command//-/_}"
if declare -F "${completion_func}" > /dev/null; then
${completion_func}
fi
return 0
}
complete -F _docker_machine docker-machine docker-machine.exe

View File

@@ -1,21 +1,24 @@
#!/usr/bin/env bash # shellcheck shell=bash
cite "about-completion"
about-completion "docker completion"
# Make sure docker is installed # Make sure docker is installed
_command_exists docker || return _command_exists docker || return
# Don't handle completion if it's already managed # Don't handle completion if it's already managed
complete -p docker &>/dev/null && return _completion_exists docker && return
_docker_bash_completion_paths=( _docker_bash_completion_paths=(
# MacOS # MacOS
'/Applications/Docker.app/Contents/Resources/etc/docker.bash-completion' '/Applications/Docker.app/Contents/Resources/etc/docker.bash-completion'
# Linux # Linux
'/usr/share/bash-completion/completions/docker' '/usr/share/bash-completion/completions/docker'
) )
for fn in "${_docker_bash_completion_paths[@]}" ; do for fn in "${_docker_bash_completion_paths[@]}"; do
if [ -r "$fn" ] ; then if [ -r "$fn" ]; then
source "$fn" # shellcheck disable=SC1090
break source "$fn"
fi break
fi
done done

View File

@@ -1,37 +1,2 @@
#!/usr/bin/env bash _log_warning 'Bash completion for "drush" is now deprecated, as it used code with incompatible license.
# Please disable this completion and use the instructions from "drush" developers instead.'
# bash completion support for Drush:
# https://github.com/drush-ops/drush
#
# Originally from:
# http://github.com/drush-ops/drush/blob/master/drush.complete.sh
# Ensure drush is available.
which drush &> /dev/null || alias drush &> /dev/null || return
__drush_ps1() {
f="${TMPDIR:-/tmp/}/drush-env/drush-drupal-site-$$"
if [ -f $f ]
then
__DRUPAL_SITE=$(cat "$f")
else
__DRUPAL_SITE="$DRUPAL_SITE"
fi
[[ -n "$__DRUPAL_SITE" ]] && printf "${1:- (%s)}" "$__DRUPAL_SITE"
}
# Completion function, uses the "drush complete" command to retrieve
# completions for a specific command line COMP_WORDS.
_drush_completion() {
# Set IFS to newline (locally), since we only use newline separators, and
# need to retain spaces (or not) after completions.
local IFS=$'\n'
# The '< /dev/null' is a work around for a bug in php libedit stdin handling.
# Note that libedit in place of libreadline in some distributions. See:
# https://bugs.launchpad.net/ubuntu/+source/php5/+bug/322214
COMPREPLY=( $(drush --early=includes/complete.inc "${COMP_WORDS[@]}" < /dev/null 2> /dev/null) )
}
# Register our completion function. We include common short aliases for Drush.
complete -o bashdefault -o default -o nospace -F _drush_completion d dr drush drush5 drush6 drush6 drush.php

View File

@@ -1,9 +1,14 @@
#/usr/bin/env bash # shellcheck shell=bash
# Bash completion for Google Cloud SDK cite "about-completion"
about-completion "Google Cloud SDK completion"
if which gcloud >/dev/null 2>&1; then if _command_exists gcloud; then
GOOGLE_SDK_ROOT=${GOOGLE_SDK_ROOT:-$(gcloud info --format="value(installation.sdk_root)")} # get install path
for i in $(ls ${GOOGLE_SDK_ROOT}/*.bash.inc); do GOOGLE_SDK_ROOT=${GOOGLE_SDK_ROOT:-$(gcloud info --format="value(installation.sdk_root)")}
source $i
done # source all the bash completion file that are available
for i in "${GOOGLE_SDK_ROOT}"/*.bash.inc; do
# shellcheck disable=SC1090
source "$i"
done
fi fi

View File

@@ -1,41 +1,35 @@
#!/usr/bin/env bash # shellcheck shell=bash
# Completion for gem cite "about-completion"
about-completion "gem completion"
_installcomp() { __gem_completion() {
if [ -z "$REMOTE_GEMS" ] local cur=${COMP_WORDS[COMP_CWORD]}
then local prev=${COMP_WORDS[COMP_CWORD - 1]}
REMOTE_GEMS=( $(gem list --remote --no-versions | tr '\n' ' ') ) case $prev in
fi install)
# list the remote gems and add to completion
local cur=${COMP_WORDS[COMP_CWORD]} if [ -z "$REMOTE_GEMS" ]; then
COMPREPLY=( $(compgen -W "${REMOTE_GEMS[*]}" -- $cur) ) read -r -a REMOTE_GEMS <<< "$(gem list --remote --no-versions | sed 's/\*\*\* REMOTE GEMS \*\*\*//' | tr '\n' ' ')"
fi
local cur=${COMP_WORDS[COMP_CWORD]}
# shellcheck disable=SC2207
COMPREPLY=($(compgen -W "${REMOTE_GEMS[*]}" -- "$cur"))
return 0
;;
uninstall)
# list all local installed gems and add to completion
read -r -a LOCAL_GEMS <<< "$(gem list --no-versions | sed 's/\*\*\* LOCAL GEMS \*\*\*//' | tr '\n' ' ')"
local cur=${COMP_WORDS[COMP_CWORD]}
# shellcheck disable=SC2207
COMPREPLY=($(compgen -W "${LOCAL_GEMS[*]}" -- "$cur"))
return 0
;;
esac
local commands=(build cert check cleanup contents dependency environment fetch generate_index help install list lock outdated owner pristine push query rdoc search server sources specification stale uninstall unpack update which)
# shellcheck disable=SC2207
COMPREPLY=($(compgen -W "${commands[*]}" -- "$cur"))
} }
_uninstallcomp() { complete -F __gem_completion gem
if [ -z "$LOCAL_GEMS" ]
then
LOCAL_GEMS=( $(gem list --no-versions | sed 's/\*\*\* LOCAL GEMS \*\*\*//' | tr '\n' ' ') )
fi
local cur=${COMP_WORDS[COMP_CWORD]}
COMPREPLY=( $(compgen -W "${LOCAL_GEMS[*]}" -- $cur) )
}
_gem() {
local cur=${COMP_WORDS[COMP_CWORD]}
local prev=${COMP_WORDS[COMP_CWORD-1]}
case $prev in
install)
_installcomp
return 0
;;
uninstall)
_uninstallcomp
return 0
;;
esac
local commands=(build cert check cleanup contents dependency environment fetch generate_index help install list lock outdated owner pristine push query rdoc search server sources specification stale uninstall unpack update which)
COMPREPLY=( $(compgen -W "${commands[*]}" -- $cur) )
}
complete -F _gem gem

View File

@@ -2,47 +2,47 @@
# #
# git-flow-completion # git-flow-completion
# =================== # ===================
# #
# Bash completion support for [git-flow](http://github.com/nvie/gitflow) # Bash completion support for [git-flow](http://github.com/nvie/gitflow)
# #
# The contained completion routines provide support for completing: # The contained completion routines provide support for completing:
# #
# * git-flow init and version # * git-flow init and version
# * feature, hotfix and release branches # * feature, hotfix and release branches
# * remote feature branch names (for `git-flow feature track`) # * remote feature branch names (for `git-flow feature track`)
# #
# #
# Installation # Installation
# ------------ # ------------
# #
# To achieve git-flow completion nirvana: # To achieve git-flow completion nirvana:
# #
# 0. Install git-completion. # 0. Install git-completion.
# #
# 1. Install this file. Either: # 1. Install this file. Either:
# #
# a. Place it in a `bash-completion.d` folder: # a. Place it in a `bash-completion.d` folder:
# #
# * /etc/bash-completion.d # * /etc/bash-completion.d
# * /usr/local/etc/bash-completion.d # * /usr/local/etc/bash-completion.d
# * ~/bash-completion.d # * ~/bash-completion.d
# #
# b. Or, copy it somewhere (e.g. ~/.git-flow-completion.sh) and put the following line in # b. Or, copy it somewhere (e.g. ~/.git-flow-completion.sh) and put the following line in
# your .bashrc: # your .bashrc:
# #
# source ~/.git-flow-completion.sh # source ~/.git-flow-completion.sh
# #
# 2. If you are using Git < 1.7.1: Edit git-completion.sh and add the following line to the giant # 2. If you are using Git < 1.7.1: Edit git-completion.sh and add the following line to the giant
# $command case in _git: # $command case in _git:
# #
# flow) _git_flow ;; # flow) _git_flow ;;
# #
# #
# The Fine Print # The Fine Print
# -------------- # --------------
# #
# Copyright (c) 2010 [Justin Hileman](http://justinhileman.com) # Copyright (c) 2010 [Justin Hileman](http://justinhileman.com)
# #
# Distributed under the [MIT License](http://creativecommons.org/licenses/MIT/) # Distributed under the [MIT License](http://creativecommons.org/licenses/MIT/)
_git_flow () _git_flow ()
@@ -128,7 +128,7 @@ __git_flow_release ()
__gitcomp "$subcommands" __gitcomp "$subcommands"
return return
fi fi
case "$subcommand" in case "$subcommand" in
finish) finish)
__gitcomp "$(__git_flow_list_releases)" __gitcomp "$(__git_flow_list_releases)"
@@ -174,4 +174,4 @@ __git_flow_list_hotfixes ()
# temporarily wrap __git_find_on_cmdline() for backwards compatibility # temporarily wrap __git_find_on_cmdline() for backwards compatibility
if [ -z "`type -t __git_find_subcommand`" ]; then if [ -z "`type -t __git_find_subcommand`" ]; then
alias __git_find_subcommand=__git_find_on_cmdline alias __git_find_subcommand=__git_find_on_cmdline
fi fi

View File

@@ -1,10 +1,9 @@
#!/usr/bin/env bash # shellcheck shell=bash
cite "about-completion" cite "about-completion"
about-completion "GitHub CLI completion" about-completion "GitHub CLI completion"
if _command_exists gh; then if _binary_exists gh; then
if _command_exists brew; then # If gh already completed, stop
_log_warning "You don't need github-cli completion enabled if you have system completion enabled" _completion_exists gh && return
fi eval "$(gh completion --shell=bash)"
eval "$(gh completion --shell=bash)"
fi fi

View File

@@ -1,13 +1,15 @@
#!/usr/bin/env bash # shellcheck shell=bash
about-completion "completion for go command using gocomplete"
# bash completion for go tool # bash completion for go tool
# https://github.com/posener/complete # https://github.com/posener/complete
# https://pkg.go.dev/github.com/posener/complete?tab=doc
# Install gocomplete: # Test `go version` because goenv creates shim scripts that will be found in PATH
# go get -u github.com/posener/complete/gocomplete # but do not always resolve to a working install.
# gocomplete -install if _command_exists go && go version &> /dev/null; then
# Same idea here, but no need to test a subcommand
if _command_exists gocomplete && _command_exists go ; then if _command_exists gocomplete && gocomplete &> /dev/null; then
complete -C "${GOBIN}"/gocomplete go # finally, apply completion
complete -C gocomplete go
fi
fi fi

View File

@@ -1,3 +1,23 @@
# Copyright (c) 2017 Eric Wendelin
# Permission is hereby granted, free of charge, to any person obtaining a copy of
# this software and associated documentation files (the "Software"), to deal in
# the Software without restriction, including without limitation the rights to
# use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
# of the Software, and to permit persons to whom the Software is furnished to do
# so, subject to the following conditions:
# The above copyright notice and this permission notice shall be included in all
# copies or substantial portions of the Software.
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
# SOFTWARE.
# Bash breaks words on : by default. Subproject tasks have ':' # Bash breaks words on : by default. Subproject tasks have ':'
# Avoid inaccurate completions for subproject tasks # Avoid inaccurate completions for subproject tasks
COMP_WORDBREAKS=$(echo "$COMP_WORDBREAKS" | sed -e 's/://g') COMP_WORDBREAKS=$(echo "$COMP_WORDBREAKS" | sed -e 's/://g')

View File

@@ -3,9 +3,35 @@
# grunt-cli # grunt-cli
# http://gruntjs.com/ # http://gruntjs.com/
# #
# Copyright (c) 2012 Tyler Kellen, contributors # Copyright jQuery Foundation and other contributors, https://jquery.org/
# Licensed under the MIT license.
# https://github.com/gruntjs/grunt/blob/master/LICENSE-MIT # This software consists of voluntary contributions made by many
# individuals. For exact contribution history, see the revision history
# available at https://github.com/gruntjs/grunt .
# The following license applies to all parts of this software except as
# documented below:
# ====
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and associated documentation files (the
# "Software"), to deal in the Software without restriction, including
# without limitation the rights to use, copy, modify, merge, publish,
# distribute, sublicense, and/or sell copies of the Software, and to
# permit persons to whom the Software is furnished to do so, subject to
# the following conditions:
# The above copyright notice and this permission notice shall be
# included in all copies or substantial portions of the Software.
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
# EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
# Usage: # Usage:
# #

View File

@@ -2,9 +2,36 @@
# Borrowed from grunt-cli # Borrowed from grunt-cli
# http://gruntjs.com/ # http://gruntjs.com/
# #
# Copyright (c) 2012 Tyler Kellen, contributors # Copyright jQuery Foundation and other contributors, https://jquery.org/
# Licensed under the MIT license.
# https://github.com/gruntjs/grunt/blob/master/LICENSE-MIT # This software consists of voluntary contributions made by many
# individuals. For exact contribution history, see the revision history
# available at https://github.com/gruntjs/grunt .
# The following license applies to all parts of this software except as
# documented below:
# ====
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and associated documentation files (the
# "Software"), to deal in the Software without restriction, including
# without limitation the rights to use, copy, modify, merge, publish,
# distribute, sublicense, and/or sell copies of the Software, and to
# permit persons to whom the Software is furnished to do so, subject to
# the following conditions:
# The above copyright notice and this permission notice shall be
# included in all copies or substantial portions of the Software.
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
# EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
# Usage: # Usage:
# #
# To enable bash <tab> completion for gulp, add the following line (minus the # To enable bash <tab> completion for gulp, add the following line (minus the

View File

@@ -1,8 +1,7 @@
#!/usr/bin/env bash # shellcheck shell=bash
cite "about-completion"
about-completion "helm (Kubernetes Package Manager) completion"
# helm (Kubernetes Package Manager) completion if _command_exists helm; then
eval "$(helm completion bash)"
if command -v helm &>/dev/null
then
eval "$(helm completion bash)"
fi fi

View File

@@ -1,60 +1,2 @@
# Bash completion script for homesick _log_warning 'Bash completion for "homesick" is now deprecated, as it used unlicensed code.
# Please disable this completion and use the instructions from "homesick" bash completion developers instead.'
# The homebrew bash completion script was used as inspiration.
# Originally from https://github.com/liborw/homesick-completion
_homesick_complete()
{
local cur="${COMP_WORDS[COMP_CWORD]}"
local options="--skip --force --pretend --quiet"
local actions="cd clone commit destroy diff generate help list open pull push rc show_path status symlink track unlink version"
local repos=$(\ls ~/.homesick/repos)
# Subcommand list
[[ ${COMP_CWORD} -eq 1 ]] && {
COMPREPLY=( $(compgen -W "${options} ${actions}" -- ${cur}) )
return
}
# Find the first non-switch word
local prev_index=1
local prev="${COMP_WORDS[prev_index]}"
while [[ $prev == -* ]]; do
prev_index=$((++prev_index))
prev="${COMP_WORDS[prev_index]}"
done
# Find the number of non-"--" commands
local num=0
for word in ${COMP_WORDS[@]}
do
if [[ $word != -* ]]; then
num=$((++num))
fi
done
case "$prev" in
# Commands that take a castle
cd|commit|destroy|diff|open|pull|push|rc|show_path|status|symlink|unlink)
COMPREPLY=( $(compgen -W "${repos}" -- ${cur}) )
return
;;
# Commands that take command
help)
COMPREPLY=( $(compgen -W "${actions}" -- ${cur}) )
return
;;
# Track command take file and repo
track)
if [[ "$num" -eq 2 ]]; then
COMPREPLY=( $(compgen -X -f ${cur}) )
elif [[ "$num" -ge 3 ]]; then
COMPREPLY=( $(compgen -W "${repos}" -- ${cur}) )
fi
return
;;
esac
}
complete -o bashdefault -o default -F _homesick_complete homesick

View File

@@ -1,6 +1,27 @@
# hub tab-completion script for bash. # hub tab-completion script for bash.
# This script complements the completion script that ships with git. # This script complements the completion script that ships with git.
# Copyright (c) 2009 Chris Wanstrath
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and associated documentation files (the
# "Software"), to deal in the Software without restriction, including
# without limitation the rights to use, copy, modify, merge, publish,
# distribute, sublicense, and/or sell copies of the Software, and to
# permit persons to whom the Software is furnished to do so, subject to
# the following conditions:
# The above copyright notice and this permission notice shall be
# included in all copies or substantial portions of the Software.
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
# EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
# If there is no git tab completion, but we have the _completion loader try to load it # If there is no git tab completion, but we have the _completion loader try to load it
if ! declare -F _git > /dev/null && declare -F _completion_loader > /dev/null; then if ! declare -F _git > /dev/null && declare -F _completion_loader > /dev/null; then
_completion_loader git _completion_loader git

View File

@@ -1,4 +1,28 @@
# Invoke (pyinvoke.org) tab-completion script to be sourced with Bash shell. # Invoke (pyinvoke.org) tab-completion script to be sourced with Bash shell.
# Copyright (c) 2020 Jeff Forcier.
# All rights reserved.
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
# * Redistributions of source code must retain the above copyright notice,
# this list of conditions and the following disclaimer.
# * Redistributions in binary form must reproduce the above copyright notice,
# this list of conditions and the following disclaimer in the documentation
# and/or other materials provided with the distribution.
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
# DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
# SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
# CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
# OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
# https://github.com/pyinvoke/invoke/blob/master/completion/bash # https://github.com/pyinvoke/invoke/blob/master/completion/bash
_complete_invoke() { _complete_invoke() {
@@ -28,4 +52,3 @@ _complete_invoke() {
# * -o default: when function generates no results, use filenames. # * -o default: when function generates no results, use filenames.
# * positional args: program names to complete for. # * positional args: program names to complete for.
complete -F _complete_invoke -o default invoke inv complete -F _complete_invoke -o default invoke inv

View File

@@ -0,0 +1,4 @@
# shellcheck shell=bash
about-completion "jboss5 completion"
# shellcheck disable=SC1090
source "${BASH_IT}"/vendor/github.com/rparree/jboss-bash-completion/jboss5

View File

@@ -1,141 +1,4 @@
# Completions for JBoss Application Server 7 (EAP 6) # shellcheck shell=bash
# VERSION: 0.6 about-completion "jboss7 completion"
# DATE: 2012-10-30 # shellcheck disable=SC1090
# rparree-at-edc4it-dot-com source "${BASH_IT}"/vendor/github.com/rparree/jboss-bash-completion/jboss7
_serverProfiles(){
if [[ $COMP_WORDS == *standalone.sh* ]]
then
serverdir="../standalone/configuration/"
else
# assume is domain.sh
serverdir="../domain/configuration/"
fi
for i in ${!COMP_WORDS[*]}
do
if [[ "${COMP_WORDS[i]}" == "-Djboss.server.base.dir" || "${COMP_WORDS[i]}" == "-Djboss.domain.base.dir" ]]; then
serverdir="${COMP_WORDS[i+2]}/configuration"
fi
done
if [ -d "${serverdir}" ]
then
IFS=$'\n' tmp="$(ls "${serverdir}" | grep xml)"
local fls="${tmp[@]// /\ }"
unset IFS
COMPREPLY=( $(compgen -W "${fls} initial boot last v" -- "$cur" ))
fi
}
_bindingAddress(){
# from /etc/bash_completion.d/ssh
COMPREPLY=( "${COMPREPLY[@]}" $( compgen -W \
"0.0.0.0 $( PATH="$PATH:/sbin" ifconfig -a | \
sed -ne 's/.*addr:\([^[:space:]]*\).*/\1/p' \
-ne 's/.*inet[[:space:]]\{1,\}\([^[:space:]]*\).*/\1/p' )" \
-- "$cur" ) )
}
_jboss(){
local cur prev words cword
COMPREPLY=()
_get_comp_words_by_ref -n = cur prev words cword
case $cur in
-Djboss.socket.binding.port-offset=*)
cur=${cur#*=}
#static list of common bindings sets
local bindings="100 200 300 400 10000 20000 30000 40000"
COMPREPLY=( $(compgen -W "${bindings}" -- ${cur}) )
return 0
;;
-Djboss.default.jgroups.stack=*)
cur=${cur#*=}
#static list of standard JGroups stacks
local stacks="udp udp-async udp-sync tcp tcp-sync"
COMPREPLY=( $(compgen -W "${stacks}" -- ${cur}) )
return 0
;;
-Dorg.jboss.ejb3.remoting.IsLocalInterceptor.passByRef=*|-Dcom.sun.management.jmxremote.authenticate=*|-Dcom.sun.management.jmxremote.ssl=*)
cur=${cur#*=}
local booleans="true false"
COMPREPLY=( $(compgen -W "${booleans}" -- ${cur}) )
return 0
;;
-Djboss.server.base.dir=*|-Djboss.home.dir=*|-Djboss.domain.base.dir=*)
cur=${cur#*=}
_filedir -d
return 0
;;
-Djboss.domain.master.address=*|-Djboss.bind.address*=*)
cur=${cur#*=}
_bindingAddress
return 0
;;
--server-config=*|-c=|--host-config=*)
cur=${cur#*=}
_serverProfiles
return 0
esac
case $prev in
-u)
# a few from RFC 2365 IPv4 Local Scope ()
local addresses="239.255.0.1 239.255.0.2 239.255.0.3"
COMPREPLY=( $(compgen -W "${addresses}" -- ${cur}) )
return 0
;;
-b*)
_bindingAddress
return 0
;;
-c)
_serverProfiles
return 0
;;
*)
;;
esac
# *** from jboss5 ********************
# *** -modulepath -c -m -g -l -d -p -n -B -L -C -Djboss.platform.mbeanserver -Djboss.server.base.directory
# *** -Djboss.Domain -Djboss.modcluster.proxyList -Djboss.jvmRoute -Djboss.default.jgroups.stack -Dorg.jboss.ejb3.remoting.IsLocalInterceptor.passByRef -Djboss.platform.mbeanserver -Dcom.sun.management.jmxremote.port -Dcom.sun.management.jmxremote.ssl
# *************************************
# standard commands for standalone and domain mode
local commandsWithoutEqualSign='-b -bmanagement -bunsecure -bpublic --admin-only -h -help -u -version -V -v'
local commandsWithEqualSign='-P -Djboss.node.name -Djboss.home.dir -Djboss.socket.binding.port-offset -Djboss.bind.address.management -Djboss.bind.address -Djboss.bind.address.unsecure'
if [[ $COMP_WORDS == *standalone.sh* ]]
then
commandsWithoutEqualSign="${commandsWithoutEqualSign} -c"
commandsWithEqualSign="${commandsWithEqualSign} --server-config -Djboss.server.base.dir -c"
else
# assume is domain.sh
commandsWithoutEqualSign="${commandsWithoutEqualSign} --backup --cached-dc"
commandsWithEqualSign="${commandsWithEqualSign} -Djboss.domain.master.address --host-config -Djboss.domain.master.port -Djboss.domain.base.dir "
fi
COMPREPLY=( $( compgen -W "$commandsWithoutEqualSign" -- "$cur" )
$( compgen -W "$commandsWithEqualSign" -S '=' -- "$cur" ) )
return 0
}
complete -o nospace -F _jboss standalone.sh
complete -o nospace -F _jboss domain.sh

View File

@@ -1 +1,7 @@
[[ -x "$(which jungle)" ]] && eval "$(_JUNGLE_COMPLETE=source jungle)" # shellcheck shell=bash
cite "about-completion"
about-completion "jungle(AWS cli tool) completion"
if _command_exists jungle; then
eval "$(_JUNGLE_COMPLETE=source jungle)"
fi

View File

@@ -3,4 +3,3 @@
if _command_exists kind; then if _command_exists kind; then
eval "$(kind completion bash)" eval "$(kind completion bash)"
fi fi

View File

@@ -1,4 +1,6 @@
#!/usr/bin/env bash # shellcheck shell=bash
# Published originally as public domain code at https://github.com/wk8/knife-bash-autocomplete
############## ##############
### CONFIG ### ### CONFIG ###
@@ -19,7 +21,7 @@ _KNIFE_AUTOCOMPLETE_MAX_CACHE_AGE=86400
### init ### init
_KAC_CACHE_TMP_DIR="$_KNIFE_AUTOCOMPLETE_CACHE_DIR/tmp" _KAC_CACHE_TMP_DIR="$_KNIFE_AUTOCOMPLETE_CACHE_DIR/tmp"
# make sure the cache dir exists # make sure the cache dir exists
mkdir -p $_KAC_CACHE_TMP_DIR mkdir -p "$_KAC_CACHE_TMP_DIR"
############################## ##############################
### Cache helper functions ### ### Cache helper functions ###
@@ -31,177 +33,169 @@ stat -c %Y /dev/null > /dev/null 2>&1 && _KAC_STAT_COMMAND="stat -c %Y" || _KAC_
# returns 0 iff the file whose path is given as 1st argument # returns 0 iff the file whose path is given as 1st argument
# exists and has last been modified in the last $2 seconds # exists and has last been modified in the last $2 seconds
# returns 1 otherwise # returns 1 otherwise
_KAC_is_file_newer_than() _KAC_is_file_newer_than() {
{ [ -f "$1" ] || return 1
[ -f "$1" ] || return 1 [ $(($(date +%s) - $($_KAC_STAT_COMMAND "$1"))) -gt "$2" ] && return 1 || return 0
[ $(( $(date +%s) - $($_KAC_STAT_COMMAND "$1") )) -gt $2 ] && return 1 || return 0
} }
# helper function for _KAC_get_and_regen_cache, see doc below # helper function for _KAC_get_and_regen_cache, see doc below
_KAC_regen_cache() _KAC_regen_cache() {
{ local CACHE_NAME=$1
local CACHE_NAME=$1 local CACHE_PATH="$_KNIFE_AUTOCOMPLETE_CACHE_DIR/$CACHE_NAME"
local CACHE_PATH="$_KNIFE_AUTOCOMPLETE_CACHE_DIR/$CACHE_NAME" local TMP_FILE=$(mktemp "$_KAC_CACHE_TMP_DIR/$CACHE_NAME.XXXX")
local TMP_FILE=$(mktemp "$_KAC_CACHE_TMP_DIR/$CACHE_NAME.XXXX") shift 1
shift 1 # discard the temp file if it's empty AND the previous command didn't exit successfully, but still mark the cache as updated
"$@" > $TMP_FILE 2> /dev/null if ! "$@" > "$TMP_FILE" 2> /dev/null; then
# discard the temp file if it's empty AND the previous command didn't exit successfully, but still mark the cache as updated [[ $(wc -l "$TMP_FILE") == 0 ]] && rm -f "$TMP_FILE" && touch "$CACHE_PATH" && return 1
[[ $? != 0 ]] && [[ $(cat $TMP_FILE | wc -l) == 0 ]] && rm -f $TMP_FILE && touch $CACHE_PATH && return 1 \ else
|| mv -f $TMP_FILE $CACHE_PATH mv -f "$TMP_FILE" "$CACHE_PATH"
fi
} }
# cached files can't have spaces in their names # cached files can't have spaces in their names
_KAC_get_cache_name_from_command() _KAC_get_cache_name_from_command() {
{ echo "${@/ /_SPACE_}"
echo "$@" | sed 's/ /_SPACE_/g'
} }
# the reverse operation from the function above # the reverse operation from the function above
_KAC_get_command_from_cache_name() _KAC_get_command_from_cache_name() {
{ echo "${@/_SPACE_/ }"
echo "$@" | sed 's/_SPACE_/ /g'
} }
# given a command as argument, it fetches the cache for that command if it can find it # given a command as argument, it fetches the cache for that command if it can find it
# otherwise it waits for the cache to be generated # otherwise it waits for the cache to be generated
# in either case, it regenerates the cache, and sets the _KAC_CACHE_PATH env variable # in either case, it regenerates the cache, and sets the _KAC_CACHE_PATH env variable
# for obvious reason, do NOT call that in a sub-shell (in particular, no piping) # for obvious reason, do NOT call that in a sub-shell (in particular, no piping)
_KAC_get_and_regen_cache() _KAC_get_and_regen_cache() {
{ # the cache name can't have space in it
# the cache name can't have space in it local CACHE_NAME=$(_KAC_get_cache_name_from_command "$@")
local CACHE_NAME=$(_KAC_get_cache_name_from_command "$@") local REGEN_CMD="_KAC_regen_cache $CACHE_NAME $*"
local REGEN_CMD="_KAC_regen_cache $CACHE_NAME $@" _KAC_CACHE_PATH="$_KNIFE_AUTOCOMPLETE_CACHE_DIR/$CACHE_NAME"
_KAC_CACHE_PATH="$_KNIFE_AUTOCOMPLETE_CACHE_DIR/$CACHE_NAME" # no need to wait for the regen if the file already exists
# no need to wait for the regen if the file already exists if [[ -f "$_KAC_CACHE_PATH" ]]; then
[ -f $_KAC_CACHE_PATH ] && ($REGEN_CMD &) || $REGEN_CMD ($REGEN_CMD &)
else
$REGEN_CMD
fi
} }
# performs two things: first, deletes all obsolete temp files # performs two things: first, deletes all obsolete temp files
# then refreshes stale caches that haven't been called in a long time # then refreshes stale caches that haven't been called in a long time
_KAC_clean_cache() _KAC_clean_cache() {
{ local FILE CMD
local FILE CMD # delete all obsolete temp files, could be lingering there for any kind of crash in the caching process
# delete all obsolete temp files, could be lingering there for any kind of crash in the caching process for FILE in "$_KAC_CACHE_TMP_DIR"/*; do
for FILE in $(ls $_KAC_CACHE_TMP_DIR) _KAC_is_file_newer_than "$FILE" "$_KNIFE_AUTOCOMPLETE_MAX_CACHE_AGE" || rm -f "$FILE"
do done
_KAC_is_file_newer_than $FILE $_KNIFE_AUTOCOMPLETE_MAX_CACHE_AGE || rm -f $FILE # refresh really stale caches
done find "$_KNIFE_AUTOCOMPLETE_CACHE_DIR" -maxdepth 1 -type f -not -name '.*' \
# refresh really stale caches | while read -r FILE; do
for FILE in $(find $_KNIFE_AUTOCOMPLETE_CACHE_DIR -maxdepth 1 -type f -not -name '.*') _KAC_is_file_newer_than "$FILE" "$_KNIFE_AUTOCOMPLETE_MAX_CACHE_AGE" && continue
do # first let's get the original command
_KAC_is_file_newer_than $FILE $_KNIFE_AUTOCOMPLETE_MAX_CACHE_AGE && continue CMD=$(_KAC_get_command_from_cache_name "$(basename "$FILE")")
# first let's get the original command # then regen the cache
CMD=$(_KAC_get_command_from_cache_name $(basename "$FILE")) _KAC_get_and_regen_cache "$CMD" > /dev/null
# then regen the cache done
_KAC_get_and_regen_cache "$CMD" > /dev/null
done
} }
# perform a cache cleaning when loading this file # perform a cache cleaning when loading this file
_KAC_clean_cache # On big systems this could baloon up to a 30 second run or more, so not enabling by default.
[[ "${KNIFE_CACHE_CLEAN}" ]] && _KAC_clean_cache
##################################### #####################################
### End of cache helper functions ### ### End of cache helper functions ###
##################################### #####################################
# returns all the possible knife sub-commands # returns all the possible knife sub-commands
_KAC_knife_commands() _KAC_knife_commands() {
{ knife --help | grep -E "^knife" | sed -E 's/ \(options\)//g'
knife --help | grep -E "^knife" | sed -E 's/ \(options\)//g'
} }
# rebuilds the knife base command currently being completed, and assigns it to $_KAC_CURRENT_COMMAND # rebuilds the knife base command currently being completed, and assigns it to $_KAC_CURRENT_COMMAND
# additionnally, returns 1 iff the current base command is not complete, 0 otherwise # additionnally, returns 1 iff the current base command is not complete, 0 otherwise
# also sets $_KAC_CURRENT_COMMAND_NB_WORDS if the base command is complete # also sets $_KAC_CURRENT_COMMAND_NB_WORDS if the base command is complete
_KAC_get_current_base_command() _KAC_get_current_base_command() {
{ local PREVIOUS="knife"
local PREVIOUS="knife" local I=1
local I=1 local CURRENT
local CURRENT while [ $I -le "$COMP_CWORD" ]; do
while [ $I -le $COMP_CWORD ] # command words are all lower-case
do echo "${COMP_WORDS[$I]}" | grep -E "^[a-z]+$" > /dev/null || break
# command words are all lower-case CURRENT="$PREVIOUS ${COMP_WORDS[$I]}"
echo ${COMP_WORDS[$I]} | grep -E "^[a-z]+$" > /dev/null || break grep -E "^$CURRENT" "$_KAC_CACHE_PATH" > /dev/null || break
CURRENT="$PREVIOUS ${COMP_WORDS[$I]}" PREVIOUS=$CURRENT
cat $_KAC_CACHE_PATH | grep -E "^$CURRENT" > /dev/null || break I=$((I + 1))
PREVIOUS=$CURRENT done
I=$(( $I + 1)) _KAC_CURRENT_COMMAND=$PREVIOUS
done [ $I -le "$COMP_CWORD" ] && _KAC_CURRENT_COMMAND_NB_WORDS=$I
_KAC_CURRENT_COMMAND=$PREVIOUS
[ $I -le $COMP_CWORD ] && _KAC_CURRENT_COMMAND_NB_WORDS=$I
} }
# searches the position of the currently completed argument in the current base command # searches the position of the currently completed argument in the current base command
# (i.e. handles "plural" arguments such as knife cookbook upload cookbook1 cookbook2 and so on...) # (i.e. handles "plural" arguments such as knife cookbook upload cookbook1 cookbook2 and so on...)
# assumes the current base command is complete # assumes the current base command is complete
_KAC_get_current_arg_position() _KAC_get_current_arg_position() {
{ local CURRENT_ARG_POS=$((_KAC_CURRENT_COMMAND_NB_WORDS + 1))
local CURRENT_ARG_POS=$(( $_KAC_CURRENT_COMMAND_NB_WORDS + 1 )) local COMPLETE_COMMAND=$(grep -E "^$_KAC_CURRENT_COMMAND" "$_KAC_CACHE_PATH")
local COMPLETE_COMMAND=$(cat $_KAC_CACHE_PATH | grep -E "^$_KAC_CURRENT_COMMAND") local CURRENT_ARG
local CURRENT_ARG while [ "$CURRENT_ARG_POS" -le "$COMP_CWORD" ]; do
while [ $CURRENT_ARG_POS -le $COMP_CWORD ] CURRENT_ARG=$(echo "$COMPLETE_COMMAND" | cut -d ' ' -f "$CURRENT_ARG_POS")
do # we break if the current arg is a "plural" arg
CURRENT_ARG=$(echo $COMPLETE_COMMAND | cut -d ' ' -f $CURRENT_ARG_POS) echo "$CURRENT_ARG" | grep -E "^\\[[^]]+(\\.\\.\\.\\]|$)" > /dev/null && break
# we break if the current arg is a "plural" arg CURRENT_ARG_POS=$((CURRENT_ARG_POS + 1))
echo $CURRENT_ARG | grep -E "^\\[[^]]+(\\.\\.\\.\\]|$)" > /dev/null && break done
CURRENT_ARG_POS=$(( $CURRENT_ARG_POS + 1 )) echo "$CURRENT_ARG_POS"
done
echo $CURRENT_ARG_POS
} }
# the actual auto-complete function # the actual auto-complete function
_knife() _knife() {
{ _KAC_get_and_regen_cache _KAC_knife_commands
_KAC_get_and_regen_cache _KAC_knife_commands local RAW_LIST ITEM REGEN_CMD ARG_POSITION
local RAW_LIST ITEM REGEN_CMD ARG_POSITION COMREPLY=()
COMREPLY=() # get correct command & arg pos
# get correct command & arg pos _KAC_get_current_base_command && ARG_POSITION=$(_KAC_get_current_arg_position) || ARG_POSITION=$((COMP_CWORD + 1))
_KAC_get_current_base_command && ARG_POSITION=$(_KAC_get_current_arg_position) || ARG_POSITION=$(( $COMP_CWORD + 1 )) RAW_LIST=$(grep -E "^$_KAC_CURRENT_COMMAND" "$_KAC_CACHE_PATH" | cut -d ' ' -f $ARG_POSITION | uniq)
RAW_LIST=$(cat $_KAC_CACHE_PATH | grep -E "^$_KAC_CURRENT_COMMAND" | cut -d ' ' -f $ARG_POSITION | uniq)
# we need to process that raw list a bit, most notably for placeholders # we need to process that raw list a bit, most notably for placeholders
# NOTE: I chose to explicitely fetch & cache _certain_ informations for the server (cookbooks & node names, etc) # NOTE: I chose to explicitely fetch & cache _certain_ informations for the server (cookbooks & node names, etc)
# as opposed to a generic approach by trying to find a 'list' knife command corresponding to the # as opposed to a generic approach by trying to find a 'list' knife command corresponding to the
# current base command - that might limit my script in some situation, but that way I'm sure it caches only # current base command - that might limit my script in some situation, but that way I'm sure it caches only
# not-sensitive stuff (a generic approach could be pretty bad e.g. with the knife-rackspace plugin) # not-sensitive stuff (a generic approach could be pretty bad e.g. with the knife-rackspace plugin)
LIST="" LIST=""
for ITEM in $RAW_LIST for ITEM in $RAW_LIST; do
do # always relevant if only lower-case chars : continuation of the base command
# always relevant if only lower-case chars : continuation of the base command echo "$ITEM" | grep -E "^[a-z]+$" > /dev/null && LIST="$LIST $ITEM" && continue
echo $ITEM | grep -E "^[a-z]+$" > /dev/null && LIST="$LIST $ITEM" && continue case "$ITEM" in
case $ITEM in *COOKBOOK*)
*COOKBOOK*) # special case for cookbooks : from site or local
# special case for cookbooks : from site or local [[ ${COMP_WORDS[2]} == 'site' ]] && REGEN_CMD="knife cookbook site list" || REGEN_CMD="knife cookbook list"
[[ ${COMP_WORDS[2]} == 'site' ]] && REGEN_CMD="knife cookbook site list" || REGEN_CMD="knife cookbook list" _KAC_get_and_regen_cache "$REGEN_CMD"
_KAC_get_and_regen_cache $REGEN_CMD LIST="$LIST $(cut -d ' ' -f 1 < "$_KAC_CACHE_PATH")"
LIST="$LIST $(cat $_KAC_CACHE_PATH | cut -d ' ' -f 1)" continue
continue ;;
;; *ITEM*)
*ITEM*) # data bag item : another special case
# data bag item : another special case local DATA_BAG_NAME=${COMP_WORDS[$((COMP_CWORD - 1))]}
local DATA_BAG_NAME=${COMP_WORDS[$(( COMP_CWORD-1 ))]} REGEN_CMD="knife data bag show $DATA_BAG_NAME"
REGEN_CMD="knife data bag show $DATA_BAG_NAME" ;;
;; *INDEX*)
*INDEX*) # see doc @ http://docs.opscode.com/knife_search.html
# see doc @ http://docs.opscode.com/knife_search.html LIST="$LIST client environment node role"
LIST="$LIST client environment node role" REGEN_CMD="knife data bag list"
REGEN_CMD="knife data bag list" ;;
;; *BAG*) REGEN_CMD="knife data bag list" ;;
*BAG*) REGEN_CMD="knife data bag list";; *CLIENT*) REGEN_CMD="knife client list" ;;
*CLIENT*) REGEN_CMD="knife client list";; *NODE*) REGEN_CMD="knife node list" ;;
*NODE*) REGEN_CMD="knife node list";; *ENVIRONMENT*) REGEN_CMD="knife environment list" ;;
*ENVIRONMENT*) REGEN_CMD="knife environment list";; *ROLE*) REGEN_CMD="knife role list" ;;
*ROLE*) REGEN_CMD="knife role list";; *USER*) REGEN_CMD="knife user list" ;;
*USER*) REGEN_CMD="knife user list";; # not a generic argument we support...
# not a generic argument we support... *) continue ;;
*) continue;; esac
esac _KAC_get_and_regen_cache "$REGEN_CMD"
_KAC_get_and_regen_cache $REGEN_CMD LIST="$LIST $(cat "$_KAC_CACHE_PATH")"
LIST="$LIST $(cat $_KAC_CACHE_PATH)" done
done # shellcheck disable=SC2207,SC2086
COMPREPLY=( $(compgen -W "${LIST}" -- ${COMP_WORDS[COMP_CWORD]})) COMPREPLY=($(compgen -W "${LIST}" -- ${COMP_WORDS[COMP_CWORD]}))
} }
#complete -f -F _knife knife
complete -F _knife knife complete -F _knife knife

View File

@@ -1 +1,5 @@
which kontena > /dev/null && . "$( kontena whoami --bash-completion-path )" # shellcheck shell=bash
if _command_exists kontena; then
# shellcheck disable=SC1090
source "$(kontena whoami --bash-completion-path)"
fi

View File

@@ -1,8 +1,7 @@
#!/usr/bin/env bash # shellcheck shell=bash
cite "about-completion"
about-completion "kubectl (Kubernetes CLI) completion"
# kubectl (Kubernetes CLI) completion if _binary_exists kubectl; then
eval "$(kubectl completion bash)"
if command -v kubectl &>/dev/null
then
eval "$(kubectl completion bash)"
fi fi

View File

@@ -10,7 +10,6 @@ if command -v laravel > /dev/null; then
fi fi
done done
} }
complete -F __laravel_completion laravel complete -F __laravel_completion laravel
fi fi

View File

@@ -1,19 +1,22 @@
#!/bin/bash # shellcheck shell=bash
# Lerna autocompletion. cite "about-completion"
function _lerna_completions() { about-completion "lerna(javascript project manager tool) completion"
local cur compls
# The currently-being-completed word. function __lerna_completion() {
cur="${COMP_WORDS[COMP_CWORD]}" local cur compls
# Options # The currently-being-completed word.
compls="add bootstrap changed clean create diff exec \ cur="${COMP_WORDS[COMP_CWORD]}"
import init link list publish run version \
--loglevel --concurrency --reject-cycles \
--progress --sort --no-sort --help \
--version"
# Tell complete what stuff to show. # Options
COMPREPLY=($(compgen -W "$compls" -- "$cur")) compls="add bootstrap changed clean create diff exec \
import init link list publish run version \
--loglevel --concurrency --reject-cycles \
--progress --sort --no-sort --help \
--version"
# Tell complete what stuff to show.
# shellcheck disable=2207
COMPREPLY=($(compgen -W "$compls" -- "$cur"))
} }
complete -o default -F _lerna_completions lerna complete -o default -F __lerna_completion lerna

View File

@@ -33,4 +33,4 @@ _mvn()
return 0 return 0
} && } &&
complete -F _mvn mvn complete -F _mvn mvn

View File

@@ -1,8 +1,6 @@
#!/usr/bin/env bash # shellcheck shell=bash
# minikube (Local Kubernetes) completion # minikube (Local Kubernetes) completion
if command -v minikube &>/dev/null if _command_exists minikube; then
then eval "$(minikube completion bash)"
eval "$(minikube completion bash)"
fi fi

View File

@@ -1,4 +1,3 @@
if _command_exists ng; then if _command_exists ng; then
# No longer supported, please see https://github.com/angular/angular-cli/issues/11043 # No longer supported, please see https://github.com/angular/angular-cli/issues/11043
# Fix courtesy of https://stackoverflow.com/questions/50194674/ng-completion-no-longer-exists # Fix courtesy of https://stackoverflow.com/questions/50194674/ng-completion-no-longer-exists

View File

@@ -0,0 +1,45 @@
# shellcheck shell=bash
__ngrok_completion() {
local prev=$(_get_pword)
local curr=$(_get_cword)
local BASE_NO_CONF="--log --log-format --log-level --help"
local BASE="--config $BASE_NO_CONF"
local DEFAULT="$BASE --authtoken --region"
case $prev in
authtoken)
# shellcheck disable=SC2207
COMPREPLY=($(compgen -W "$BASE" -- "$curr"))
;;
http)
# shellcheck disable=SC2207
COMPREPLY=($(compgen -W "$DEFAULT --auth --bind-tls --host-header --hostname --inspect --subdomain" -- "$curr"))
;;
start)
# shellcheck disable=SC2207
COMPREPLY=($(compgen -W "$DEFAULT --all --none" -- "$curr"))
;;
tcp)
# shellcheck disable=SC2207
COMPREPLY=($(compgen -W "$DEFAULT --remote-addr" -- "$curr"))
;;
tls)
# shellcheck disable=SC2207
COMPREPLY=($(compgen -W "$DEFAULT --client-cas --crt --hostname --key --subdomain" -- "$curr"))
;;
update)
# shellcheck disable=SC2207
COMPREPLY=($(compgen -W "$BASE_NO_CONF --channel" -- "$curr"))
;;
ngrok)
# shellcheck disable=SC2207
COMPREPLY=($(compgen -W "authtoken credits http start tcp tls update version help" -- "$curr"))
;;
*) ;;
esac
}
complete -F __ngrok_completion ngrok

View File

@@ -0,0 +1,19 @@
# shellcheck shell=bash
function __notify-send_completions() {
local curr=$(_get_cword)
local prev=$(_get_pword)
case $prev in
-u | --urgency)
# shellcheck disable=SC2207
COMPREPLY=($(compgen -W "low normal critical" -- "$curr"))
;;
*)
# shellcheck disable=SC2207
COMPREPLY=($(compgen -W "-? --help -u --urgency -t --expire-time -a --app-name -i --icon -c --category -h --hint -v --version" -- "$curr"))
;;
esac
}
complete -F __notify-send_completions notify-send

View File

@@ -1,9 +1,7 @@
#!/usr/bin/env bash # shellcheck shell=bash
cite "about-completion"
about-completion "npm (Node Package Manager) completion"
# npm (Node Package Manager) completion if _command_exists npm; then
# https://docs.npmjs.com/cli/completion eval "$(npm completion)"
if command -v npm &>/dev/null
then
eval "$(npm completion)"
fi fi

View File

@@ -1,164 +1,7 @@
#!/usr/bin/env bash # shellcheck shell=bash
cite "about-completion"
# Packer (http://www.packer.io) bash completion about-completion "packer completion"
#
# This script provides bash completion for packer and supports:
#
# - template filename completion (*.json) in cwd
# - support for basic options (i.e.. -debug)
# - support for complex options (i.e. -parallel=[true|false]
#
# The scirpt has been successfully tested with packer-0.6.0 and the
# following OS:
#
# - OS X 10.9
# - CentOS-6.5
# - Ubuntu 12.04 Server
#
# The script technically is heavily inspired by the git-completion.bash
# script. Kudos to Shawn O. Pearce <spearce@spearce.org> and all other
# contributors for the inspiration and especially to the bash-completion
# team in general.
#
# Copyright (c) 2014 IT Services Department, University of Bern
#
# This script is licensed under the MIT License (MIT)
# For licsense details see the LICENSE file included in the repository
# or read the license text at http://opensource.org/licenses/MIT.
#
# Generates completion reply, appending a space to possible completion words,
# if necessary.
# It accepts 2 arguments though the second is optional:
# 1: List of possible completion words.
# 2: Generate possible completion matches for this word (optional).
__packercomp ()
{
local cur_="${2-$cur}"
case "$cur_" in
-*=)
;;
*)
local c i=0 IFS=$' \t\n'
for c in $1; do
if [[ $c == "$cur_"* ]]; then
case $c in
-*=*|*.) ;;
*) c="$c " ;;
esac
COMPREPLY[i++]="$c"
fi
done
;;
esac
}
# Generates completion reply for template files in cwd.
__packercomp_template_file ()
{
local IFS=$'\n'
COMPREPLY=($(compgen -S " " -A file -X '!*.json' -- "${cur}"))
}
# Generates completion for the build command.
__packer_build ()
{
local builders="
amazon-ebs amazon-instance amazon-chroot digitalocean docker
googlecompute openstack parallels-iso parallels-pvm qemu
virtualbox-iso virtualbox-ovf vmware-iso vmware-vmx"
case "$cur" in
-parallel=*)
__packercomp "false true" "${cur##-parallel=}"
return
;;
-except=*)
__packercomp "$builders" "${cur##-except=}"
return
;;
-only=*)
__packercomp "$builders" "${cur##-only=}"
return
;;
-*)
__packercomp "-debug -force -machine-readable -except= -only= -parallel= -var -var-file"
return
;;
*)
esac
__packercomp_template_file
}
# Generates completion for the fix command.
__packer_fix ()
{
__packercomp_template_file
}
# Generates completion for the inspect command.
__packer_inspect ()
{
case "$cur" in
-*)
__packercomp "-machine-readable"
return
;;
*)
esac
__packercomp_template_file
}
# Generates completion for the validate command.
__packer_validate ()
{
__packercomp_template_file
}
# Main function for packer completion.
#
# Searches for a command in $COMP_WORDS. If one is found
# the appropriate function from above is called, if not
# completion for global options is done.
_packer_completion ()
{
cur=${COMP_WORDS[COMP_CWORD]}
# Words containing an equal sign get split into tokens in bash > 4, which
# doesn't come in handy here.
# This is handled here. bash < 4 does not split.
declare -f _get_comp_words_by_ref >/dev/null && _get_comp_words_by_ref -n = cur
COMPREPLY=()
local i c=1 command
while [ $c -lt $COMP_CWORD ]; do
i="${COMP_WORDS[c]}"
case "$i" in
-*) ;;
*) command="$i"; break ;;
esac
((c++))
done
if [ -z $command ]; then
case "$cur" in
'-'*)
__packercomp "-machine-readable --help --version"
;;
*)
__packercomp "build fix inspect validate"
;;
esac
return
fi
local completion_func="__packer_${command}"
declare -f $completion_func >/dev/null && $completion_func
}
complete -o nospace -F _packer_completion packer
if _binary_exists packer; then
complete -C packer packer
fi

View File

@@ -1,10 +1,11 @@
# shellcheck shell=bash
# https://pip.pypa.io/en/stable/user_guide/#command-completion # https://pip.pypa.io/en/stable/user_guide/#command-completion
# Of course, you should first install the pip, say on Debian: # Of course, you should first install pip, say on Debian:
# sudo apt-get install python-pip # sudo apt-get install python-pip
# sudo apt-get install python3-pip
# If the pip package is installed within virtual environments, say, python managed by pyenv, # If the pip package is installed within virtual environments, say, python managed by pyenv,
# you should first initilization the corresponding environment. # you should first initialize the corresponding environment.
# So that the pip/pip3 is in system's path. # So that pip is in the system's path.
if command -v pip >/dev/null; then if _command_exists pip; then
eval "$(pip completion --bash)" eval "$(pip completion --bash)"
fi fi

View File

@@ -1,11 +1,11 @@
# shellcheck shell=bash
# https://pip.pypa.io/en/stable/user_guide/#command-completion # https://pip.pypa.io/en/stable/user_guide/#command-completion
# Of course, you should first install the pip, say on Debian: # Of course, you should first install pip, say on Debian:
# sudo apt-get install python-pip
# sudo apt-get install python3-pip # sudo apt-get install python3-pip
# If the pip package is installed within virtual environments, say, python managed by pyenv, # If the pip package is installed within virtual environments, say, python managed by pyenv,
# you should first initilization the corresponding environment. # you should first initialize the corresponding environment.
# So that the pip/pip3 is in system's path. # So that pip3 is in the system's path.
if command -v pip3 >/dev/null; then if _command_exists pip3; then
eval "$(pip3 completion --bash)" eval "$(pip3 completion --bash)"
fi fi

View File

@@ -1 +1,4 @@
[[ -x "$(which pipenv)" ]] && eval "$(pipenv --completion)" # shellcheck shell=bash
if _command_exists pipenv; then
eval "$(pipenv --completion)"
fi

View File

@@ -0,0 +1,6 @@
# shellcheck shell=bash
# pipx completion
if _command_exists register-python-argcomplete && _command_exists pipx; then
eval "$(register-python-argcomplete pipx)"
fi

View File

@@ -44,4 +44,3 @@ _pj() {
complete -F _pj -o nospace pj complete -F _pj -o nospace pj
complete -F _pj -o nospace pjo complete -F _pj -o nospace pjo

View File

@@ -0,0 +1,7 @@
# shellcheck shell=bash
# rustup (Rust toolchain installer) completion
if _binary_exists rustup; then
eval "$(rustup completions bash)"
fi

View File

@@ -1,3 +1,18 @@
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
# Copyright (c) 2020 SaltStack Team
# Original Author:
# written by David Pravec # written by David Pravec
# - feel free to /msg alekibango on IRC if you want to talk about this file # - feel free to /msg alekibango on IRC if you want to talk about this file
@@ -13,7 +28,7 @@
_salt_get_grains(){ _salt_get_grains(){
if [ "$1" = 'local' ] ; then if [ "$1" = 'local' ] ; then
salt-call --out=txt -- grains.ls | sed 's/^.*\[//' | tr -d ",']" |sed 's:\([a-z0-9]\) :\1\: :g' salt-call --out=txt -- grains.ls | sed 's/^.*\[//' | tr -d ",']" |sed 's:\([a-z0-9]\) :\1\: :g'
else else
salt '*' --timeout 2 --out=txt -- grains.ls | sed 's/^.*\[//' | tr -d ",']" |sed 's:\([a-z0-9]\) :\1\: :g' salt '*' --timeout 2 --out=txt -- grains.ls | sed 's/^.*\[//' | tr -d ",']" |sed 's:\([a-z0-9]\) :\1\: :g'
@@ -22,23 +37,23 @@ _salt_get_grains(){
_salt_get_grain_values(){ _salt_get_grain_values(){
if [ "$1" = 'local' ] ; then if [ "$1" = 'local' ] ; then
salt-call --out=txt -- grains.item $1 |sed 's/^\S*:\s//' |grep -v '^\s*$' salt-call --out=txt -- grains.item $1 |sed 's/^\S*:\s//' |grep -v '^\s*$'
else else
salt '*' --timeout 2 --out=txt -- grains.item $1 |sed 's/^\S*:\s//' |grep -v '^\s*$' salt '*' --timeout 2 --out=txt -- grains.item $1 |sed 's/^\S*:\s//' |grep -v '^\s*$'
fi fi
} }
_salt(){ _salt(){
local cur prev opts _salt_grains _salt_coms pprev ppprev local cur prev opts _salt_grains _salt_coms pprev ppprev
COMPREPLY=() COMPREPLY=()
cur="${COMP_WORDS[COMP_CWORD]}" cur="${COMP_WORDS[COMP_CWORD]}"
prev="${COMP_WORDS[COMP_CWORD-1]}" prev="${COMP_WORDS[COMP_CWORD-1]}"
if [ ${COMP_CWORD} -gt 2 ]; then if [ ${COMP_CWORD} -gt 2 ]; then
pprev="${COMP_WORDS[COMP_CWORD-2]}" pprev="${COMP_WORDS[COMP_CWORD-2]}"
fi fi
if [ ${COMP_CWORD} -gt 3 ]; then if [ ${COMP_CWORD} -gt 3 ]; then
ppprev="${COMP_WORDS[COMP_CWORD-3]}" ppprev="${COMP_WORDS[COMP_CWORD-3]}"
fi fi
opts="-h --help -d --doc --documentation --version --versions-report -c \ opts="-h --help -d --doc --documentation --version --versions-report -c \
@@ -58,11 +73,11 @@ _salt(){
case "${pprev}" in case "${pprev}" in
-G|--grain|--grain-pcre) -G|--grain|--grain-pcre)
if [ "${cur}" = ":" ]; then if [ "${cur}" = ":" ]; then
COMPREPLY=($(compgen -W "`_salt_get_grain_values ${prev}`" )) COMPREPLY=($(compgen -W "`_salt_get_grain_values ${prev}`" ))
return 0 return 0
fi fi
;; ;;
esac esac
case "${ppprev}" in case "${ppprev}" in
-G|--grain|--grain-pcre) -G|--grain|--grain-pcre)
if [ "${prev}" = ":" ]; then if [ "${prev}" = ":" ]; then
@@ -70,17 +85,17 @@ _salt(){
return 0 return 0
fi fi
;; ;;
esac esac
if [ "${cur}" = "=" ] && [[ "${prev}" == --* ]]; then if [ "${cur}" = "=" ] && [[ "${prev}" == --* ]]; then
cur="" cur=""
fi fi
if [ "${prev}" = "=" ] && [[ "${pprev}" == --* ]]; then if [ "${prev}" = "=" ] && [[ "${pprev}" == --* ]]; then
prev="${pprev}" prev="${pprev}"
fi fi
case "${prev}" in case "${prev}" in
-c|--config) -c|--config)
COMPREPLY=($(compgen -f -- ${cur})) COMPREPLY=($(compgen -f -- ${cur}))
return 0 return 0
@@ -89,14 +104,14 @@ _salt(){
COMPREPLY=($(compgen -W "\'*\' ${opts} `salt-key --no-color -l acc`" -- ${cur})) COMPREPLY=($(compgen -W "\'*\' ${opts} `salt-key --no-color -l acc`" -- ${cur}))
return 0 return 0
;; ;;
-E|--pcre) -E|--pcre)
COMPREPLY=($(compgen -W "`salt-key --no-color -l acc`" -- ${cur})) COMPREPLY=($(compgen -W "`salt-key --no-color -l acc`" -- ${cur}))
return 0 return 0
;; ;;
-G|--grain|--grain-pcre) -G|--grain|--grain-pcre)
COMPREPLY=($(compgen -W "$(_salt_get_grains)" -- ${cur})) COMPREPLY=($(compgen -W "$(_salt_get_grains)" -- ${cur}))
return 0 return 0
;; ;;
-C|--compound) -C|--compound)
COMPREPLY=() # TODO: finish this one? how? COMPREPLY=() # TODO: finish this one? how?
return 0 return 0
@@ -109,10 +124,10 @@ _salt(){
COMPREPLY=($(compgen -W "1 2 3 4 5 6 7 8 9 10 15 20 30 40 50 60 70 80 90 100 120 150 200")) COMPREPLY=($(compgen -W "1 2 3 4 5 6 7 8 9 10 15 20 30 40 50 60 70 80 90 100 120 150 200"))
return 0 return 0
;; ;;
-N|--nodegroup) -N|--nodegroup)
MASTER_CONFIG='/etc/salt/master' MASTER_CONFIG='/etc/salt/master'
COMPREPLY=($(compgen -W "`awk -F ':' 'BEGIN {print_line = 0}; /^nodegroups/ {print_line = 1;getline } print_line && /^ */ {print $1} /^[^ ]/ {print_line = 0}' <${MASTER_CONFIG}`" -- ${cur})) COMPREPLY=($(compgen -W "`awk -F ':' 'BEGIN {print_line = 0}; /^nodegroups/ {print_line = 1;getline } print_line && /^ */ {print $1} /^[^ ]/ {print_line = 0}' <${MASTER_CONFIG}`" -- ${cur}))
return 0 return 0
;; ;;
esac esac
@@ -133,8 +148,8 @@ _saltkey(){
prev="${COMP_WORDS[COMP_CWORD-1]}" prev="${COMP_WORDS[COMP_CWORD-1]}"
opts="-c --config-dir= -h --help --version --versions-report -q --quiet \ opts="-c --config-dir= -h --help --version --versions-report -q --quiet \
-y --yes --gen-keys= --gen-keys-dir= --keysize= --key-logfile= \ -y --yes --gen-keys= --gen-keys-dir= --keysize= --key-logfile= \
-l --list= -L --list-all -a --accept= -A --accept-all \ -l --list= -L --list-all -a --accept= -A --accept-all \
-r --reject= -R --reject-all -p --print= -P --print-all \ -r --reject= -R --reject-all -p --print= -P --print-all \
-d --delete= -D --delete-all -f --finger= -F --finger-all \ -d --delete= -D --delete-all -f --finger= -F --finger-all \
--out=pprint --out=yaml --out=overstatestage --out=json --out=raw \ --out=pprint --out=yaml --out=overstatestage --out=json --out=raw \
--out=highstate --out=key --out=txt --no-color --out-indent= " --out=highstate --out=key --out=txt --no-color --out-indent= "
@@ -150,13 +165,13 @@ _saltkey(){
fi fi
if [ "${cur}" = "=" ] && [[ "${prev}" == --* ]]; then if [ "${cur}" = "=" ] && [[ "${prev}" == --* ]]; then
cur="" cur=""
fi fi
if [ "${prev}" = "=" ] && [[ "${pprev}" == --* ]]; then if [ "${prev}" = "=" ] && [[ "${pprev}" == --* ]]; then
prev="${pprev}" prev="${pprev}"
fi fi
case "${prev}" in case "${prev}" in
-a|--accept) -a|--accept)
COMPREPLY=($(compgen -W "$(salt-key -l un --no-color; salt-key -l rej --no-color)" -- ${cur})) COMPREPLY=($(compgen -W "$(salt-key -l un --no-color; salt-key -l rej --no-color)" -- ${cur}))
return 0 return 0
@@ -177,7 +192,7 @@ _saltkey(){
COMPREPLY=($(compgen -W "2048 3072 4096 5120 6144" -- ${cur})) COMPREPLY=($(compgen -W "2048 3072 4096 5120 6144" -- ${cur}))
return 0 return 0
;; ;;
--gen-keys) --gen-keys)
return 0 return 0
;; ;;
--gen-keys-dir) --gen-keys-dir)
@@ -193,7 +208,7 @@ _saltkey(){
return 0 return 0
;; ;;
--accept-all) --accept-all)
return 0 return 0
;; ;;
esac esac
COMPREPLY=($(compgen -W "${opts} " -- ${cur})) COMPREPLY=($(compgen -W "${opts} " -- ${cur}))
@@ -221,30 +236,30 @@ _saltcall(){
COMPREPLY=($(compgen -W "${opts}" -- ${cur})) COMPREPLY=($(compgen -W "${opts}" -- ${cur}))
return 0 return 0
fi fi
if [ "${cur}" = "=" ] && [[ ${prev} == --* ]]; then if [ "${cur}" = "=" ] && [[ ${prev} == --* ]]; then
cur="" cur=""
fi fi
if [ "${prev}" = "=" ] && [[ ${pprev} == --* ]]; then if [ "${prev}" = "=" ] && [[ ${pprev} == --* ]]; then
prev="${pprev}" prev="${pprev}"
fi fi
case ${prev} in case ${prev} in
-m|--module-dirs) -m|--module-dirs)
COMPREPLY=( $(compgen -d ${cur} )) COMPREPLY=( $(compgen -d ${cur} ))
return 0 return 0
;; ;;
-l|--log-level) -l|--log-level)
COMPREPLY=( $(compgen -W "info none garbage trace warning error debug" -- ${cur})) COMPREPLY=( $(compgen -W "info none garbage trace warning error debug" -- ${cur}))
return 0 return 0
;; ;;
-g|grains) -g|grains)
return 0 return 0
;; ;;
salt-call) salt-call)
COMPREPLY=($(compgen -W "${opts}" -- ${cur})) COMPREPLY=($(compgen -W "${opts}" -- ${cur}))
return 0 return 0
;; ;;
esac esac
_salt_coms="$(salt-call --out=txt -- sys.list_functions|sed 's/^.*\[//' | tr -d ",']" )" _salt_coms="$(salt-call --out=txt -- sys.list_functions|sed 's/^.*\[//' | tr -d ",']" )"
@@ -262,7 +277,7 @@ _saltcp(){
prev="${COMP_WORDS[COMP_CWORD-1]}" prev="${COMP_WORDS[COMP_CWORD-1]}"
opts="-t --timeout= -s --static -b --batch= --batch-size= \ opts="-t --timeout= -s --static -b --batch= --batch-size= \
-h --help --version --versions-report -c --config-dir= \ -h --help --version --versions-report -c --config-dir= \
-E --pcre -L --list -G --grain --grain-pcre -N --nodegroup \ -E --pcre -L --list -G --grain --grain-pcre -N --nodegroup \
-R --range -C --compound -I --pillar \ -R --range -C --compound -I --pillar \
--out=pprint --out=yaml --out=overstatestage --out=json --out=raw \ --out=pprint --out=yaml --out=overstatestage --out=json --out=raw \
--out=highstate --out=key --out=txt --no-color --out-indent= " --out=highstate --out=key --out=txt --no-color --out-indent= "
@@ -270,60 +285,59 @@ _saltcp(){
COMPREPLY=($(compgen -W "${opts}" -- ${cur})) COMPREPLY=($(compgen -W "${opts}" -- ${cur}))
return 0 return 0
fi fi
if [ "${cur}" = "=" ] && [[ "${prev}" == --* ]]; then if [ "${cur}" = "=" ] && [[ "${prev}" == --* ]]; then
cur="" cur=""
fi fi
if [ "${prev}" = "=" ] && [[ "${pprev}" == --* ]]; then if [ "${prev}" = "=" ] && [[ "${pprev}" == --* ]]; then
prev=${pprev} prev=${pprev}
fi fi
case ${prev} in
salt-cp)
COMPREPLY=($(compgen -W "${opts} `salt-key -l acc --no-color`" -- ${cur}))
return 0
;;
-t|--timeout)
# those numbers are just a hint
COMPREPLY=($(compgen -W "2 3 4 8 10 15 20 25 30 40 60 90 120 180 240 300" -- ${cur} ))
return 0
;;
-E|--pcre)
COMPREPLY=($(compgen -W "`salt-key -l acc --no-color`" -- ${cur}))
return 0
;;
-L|--list)
# IMPROVEMENTS ARE WELCOME
prefpart="${cur%,*},"
postpart=${cur##*,}
filt="^\($(echo ${cur}| sed 's:,:\\|:g')\)$"
helper=($(salt-key -l acc --no-color | grep -v "${filt}" | sed "s/^/${prefpart}/"))
COMPREPLY=($(compgen -W "${helper[*]}" -- ${cur}))
return 0 case ${prev} in
;; salt-cp)
-G|--grain|--grain-pcre) COMPREPLY=($(compgen -W "${opts} `salt-key -l acc --no-color`" -- ${cur}))
COMPREPLY=($(compgen -W "$(_salt_get_grains)" -- ${cur})) return 0
return 0 ;;
;; -t|--timeout)
# FIXME # those numbers are just a hint
-R|--range) COMPREPLY=($(compgen -W "2 3 4 8 10 15 20 25 30 40 60 90 120 180 240 300" -- ${cur} ))
# FIXME ?? return 0
return 0 ;;
;; -E|--pcre)
-C|--compound) COMPREPLY=($(compgen -W "`salt-key -l acc --no-color`" -- ${cur}))
# FIXME ?? return 0
return 0 ;;
;; -L|--list)
-c|--config) # IMPROVEMENTS ARE WELCOME
COMPREPLY=($(compgen -f -- ${cur})) prefpart="${cur%,*},"
return 0 postpart=${cur##*,}
;; filt="^\($(echo ${cur}| sed 's:,:\\|:g')\)$"
helper=($(salt-key -l acc --no-color | grep -v "${filt}" | sed "s/^/${prefpart}/"))
COMPREPLY=($(compgen -W "${helper[*]}" -- ${cur}))
return 0
;;
-G|--grain|--grain-pcre)
COMPREPLY=($(compgen -W "$(_salt_get_grains)" -- ${cur}))
return 0
;;
# FIXME
-R|--range)
# FIXME ??
return 0
;;
-C|--compound)
# FIXME ??
return 0
;;
-c|--config)
COMPREPLY=($(compgen -f -- ${cur}))
return 0
;;
esac esac
# default is using opts: # default is using opts:
COMPREPLY=( $(compgen -W "${opts}" -- ${cur}) ) COMPREPLY=( $(compgen -W "${opts}" -- ${cur}) )
} }
complete -F _saltcp salt-cp complete -F _saltcp salt-cp

View File

@@ -1,71 +1,83 @@
_sdkman_complete() # shellcheck shell=bash
{ _sdkman_complete() {
local CANDIDATES local CANDIDATES
local CANDIDATE_VERSIONS local CANDIDATE_VERSIONS
COMPREPLY=() COMPREPLY=()
if [ $COMP_CWORD -eq 1 ]; then if [ "$COMP_CWORD" -eq 1 ]; then
COMPREPLY=( $(compgen -W "install uninstall rm list ls use current outdated version default selfupdate broadcast offline help flush" -- ${COMP_WORDS[COMP_CWORD]}) ) mapfile -t COMPREPLY < <(compgen -W "install uninstall rm list ls use default home env current upgrade ug version broadcast help offline selfupdate update flush" -- "${COMP_WORDS[COMP_CWORD]}")
elif [ $COMP_CWORD -eq 2 ]; then elif [ "$COMP_CWORD" -eq 2 ]; then
case "${COMP_WORDS[COMP_CWORD-1]}" in case "${COMP_WORDS[COMP_CWORD - 1]}" in
"install" | "uninstall" | "rm" | "list" | "ls" | "use" | "current" | "outdated" ) "install" | "i" | "uninstall" | "rm" | "list" | "ls" | "use" | "u" | "default" | "d" | "home" | "h" | "current" | "c" | "upgrade" | "ug")
CANDIDATES=$(echo "${SDKMAN_CANDIDATES_CSV}" | tr ',' ' ') CANDIDATES=$(echo "${SDKMAN_CANDIDATES_CSV}" | tr ',' ' ')
COMPREPLY=( $(compgen -W "$CANDIDATES" -- ${COMP_WORDS[COMP_CWORD]}) ) mapfile -t COMPREPLY < <(compgen -W "$CANDIDATES" -- "${COMP_WORDS[COMP_CWORD]}")
;; ;;
"offline" ) "env")
COMPREPLY=( $(compgen -W "enable disable" -- ${COMP_WORDS[COMP_CWORD]}) ) mapfile -t COMPREPLY < <(compgen -W "init" -- "${COMP_WORDS[COMP_CWORD]}")
;; ;;
"selfupdate" ) "offline")
COMPREPLY=( $(compgen -W "force" -P "[" -S "]" -- ${COMP_WORDS[COMP_CWORD]}) ) mapfile -t COMPREPLY < <(compgen -W "enable disable" -- "${COMP_WORDS[COMP_CWORD]}")
;; ;;
"flush" ) "selfupdate")
COMPREPLY=( $(compgen -W "candidates broadcast archives temp" -- ${COMP_WORDS[COMP_CWORD]}) ) mapfile -t COMPREPLY < <(compgen -W "force" -- "${COMP_WORDS[COMP_CWORD]}")
;; ;;
*) "flush")
;; mapfile -t COMPREPLY < <(compgen -W "archives tmp broadcast version" -- "${COMP_WORDS[COMP_CWORD]}")
esac ;;
elif [ $COMP_CWORD -eq 3 ]; then *) ;;
case "${COMP_WORDS[COMP_CWORD-2]}" in
"uninstall" | "rm" | "use" | "default" )
_sdkman_candidate_versions ${COMP_WORDS[COMP_CWORD-1]}
COMPREPLY=( $(compgen -W "$CANDIDATE_VERSIONS" -- ${COMP_WORDS[COMP_CWORD]}) )
;;
"install")
_sdkman_candidate_not_installed_versions ${COMP_WORDS[COMP_CWORD-1]}
COMPREPLY=( $(compgen -W "$CANDIDATE_VERSIONS" -- ${COMP_WORDS[COMP_CWORD]}) )
;;
*)
;;
esac
fi
return 0 esac
elif [ "$COMP_CWORD" -eq 3 ]; then
case "${COMP_WORDS[COMP_CWORD - 2]}" in
"uninstall" | "rm" | "use" | "u" | "default" | "d" | "home" | "h")
_sdkman_candidate_local_versions "${COMP_WORDS[COMP_CWORD - 1]}"
mapfile -t COMPREPLY < <(compgen -W "$CANDIDATE_VERSIONS" -- "${COMP_WORDS[COMP_CWORD]}")
;;
"install" | "i")
_sdkman_candidate_all_versions "${COMP_WORDS[COMP_CWORD - 1]}"
mapfile -t COMPREPLY < <(compgen -W "$CANDIDATE_VERSIONS" -- "${COMP_WORDS[COMP_CWORD]}")
;;
*) ;;
esac
fi
return 0
} }
_sdkman_candidate_versions(){ _sdkman_candidate_local_versions() {
CANDIDATE_LOCAL_VERSIONS=$(__sdkman_cleanup_local_versions $1) CANDIDATE_VERSIONS=$(__sdkman_cleanup_local_versions "$1")
if [ "$SDKMAN_OFFLINE_MODE" = "true" ]; then
CANDIDATE_VERSIONS=$CANDIDATE_LOCAL_VERSIONS
else
CANDIDATE_ONLINE_VERSIONS="$(curl -s "${SDKMAN_SERVICE}/candidates/$1" | tr ',' ' ')"
CANDIDATE_VERSIONS="$(echo $CANDIDATE_ONLINE_VERSIONS $CANDIDATE_LOCAL_VERSIONS |sort | uniq ) "
fi
} }
_sdkman_candidate_not_installed_versions(){ _sdkman_candidate_all_versions() {
CANDIDATE_LOCAL_VERSIONS=$(__sdkman_cleanup_local_versions $1)
if [ "$SDKMAN_OFFLINE_MODE" = "false" ]; then candidate="$1"
CANDIDATE_ONLINE_VERSIONS="$(__sdkman_list_versions $1 | grep " " | grep "\." | cut -c 6-)" CANDIDATE_LOCAL_VERSIONS=$(__sdkman_cleanup_local_versions "$candidate")
CANDIDATE_VERSIONS="$(echo $CANDIDATE_ONLINE_VERSIONS $CANDIDATE_LOCAL_VERSIONS | tr ' ' '\n' | sort | uniq -u) " if [ "$SDKMAN_OFFLINE_MODE" = "true" ]; then
fi CANDIDATE_VERSIONS=$CANDIDATE_LOCAL_VERSIONS
else
# sdkman has a specific output format for Java candidate since
# there are multiple vendors and builds.
if [ "$candidate" = "java" ]; then
CANDIDATE_ONLINE_VERSIONS="$(__sdkman_list_versions "$candidate" | grep " " | grep "\." | cut -c 62-)"
else
CANDIDATE_ONLINE_VERSIONS="$(__sdkman_list_versions "$candidate" | grep " " | grep "\." | cut -c 6-)"
fi
# the last grep is used to filter out sdkman flags, such as:
# "+" - local version
# "*" - installed
# ">" - currently in use
CANDIDATE_VERSIONS="$(echo "$CANDIDATE_ONLINE_VERSIONS $CANDIDATE_LOCAL_VERSIONS" | tr ' ' '\n' | grep -v -e '^[[:space:]|\*|\>|\+]*$' | sort | uniq -u) "
fi
} }
__sdkman_cleanup_local_versions(){ __sdkman_cleanup_local_versions() {
__sdkman_build_version_csv $1 | tr ',' ' ' __sdkman_build_version_csv "$1" | tr ',' ' '
} }

View File

@@ -4,7 +4,7 @@
# | # |
# Thanks to Alexander Korznikov | # Thanks to Alexander Korznikov |
# http://www.korznikov.com/2014/12/bash-tab-completion-for-awesome-tool.html | # http://www.korznikov.com/2014/12/bash-tab-completion-for-awesome-tool.html |
# | # |
# ---------------------------------------------------------------------------+ # ---------------------------------------------------------------------------+
if command -v sqlmap > /dev/null; then if command -v sqlmap > /dev/null; then
@@ -18,7 +18,7 @@ if command -v sqlmap > /dev/null; then
prev=$(_get_pword) prev=$(_get_pword)
case $prev in case $prev in
# List directory content # List directory content
--tamper) --tamper)
COMPREPLY=( $( compgen -W "$tamper" -- "$cur" ) ) COMPREPLY=( $( compgen -W "$tamper" -- "$cur" ) )
@@ -108,7 +108,7 @@ if command -v sqlmap > /dev/null; then
-z --alert --answers --beep --check-waf --cleanup \ -z --alert --answers --beep --check-waf --cleanup \
--dependencies --disable-coloring --gpage --identify-waf \ --dependencies --disable-coloring --gpage --identify-waf \
--mobile --page-rank --purge-output --smart \ --mobile --page-rank --purge-output --smart \
--sqlmap-shell --wizard' -- "$cur" ) ) --sqlmap-shell --wizard' -- "$cur" ) )
# this removes any options from the list of completions that have # this removes any options from the list of completions that have
# already been specified somewhere on the command line, as long as # already been specified somewhere on the command line, as long as
# these options can only be used once (in a word, "options", in # these options can only be used once (in a word, "options", in
@@ -155,7 +155,7 @@ if command -v sqlmap > /dev/null; then
done done
printf '%s ' "${COMPREPLY[@]}") <<<"${COMP_WORDS[@]}" printf '%s ' "${COMPREPLY[@]}") <<<"${COMP_WORDS[@]}"
) ) ) )
# else # else
# _filedir bat # _filedir bat
fi fi

View File

@@ -13,8 +13,8 @@ _sshcomplete() {
# parse all defined hosts from .ssh/config and files included there # parse all defined hosts from .ssh/config and files included there
for fl in "$HOME/.ssh/config" \ for fl in "$HOME/.ssh/config" \
$(grep "^\s*Include" "$HOME/.ssh/config" | $(grep "^\s*Include" "$HOME/.ssh/config" |
awk '{for (i=2; i<=NF; i++) print $i}' | awk '{for (i=2; i<=NF; i++) print $i}' |
sed -Ee "s|^([^/~])|$HOME/.ssh/\1|" -e "s|^~/|$HOME/|") sed -Ee "s|^([^/~])|$HOME/.ssh/\1|" -e "s|^~/|$HOME/|")
do do
if [ -r "$fl" ]; then if [ -r "$fl" ]; then

View File

@@ -28,4 +28,3 @@ __kitchen_options () {
esac esac
} }
complete -F __kitchen_options kitchen complete -F __kitchen_options kitchen

View File

@@ -3,7 +3,6 @@
# tmux completion # tmux completion
# See: http://www.debian-administration.org/articles/317 for how to write more. # See: http://www.debian-administration.org/articles/317 for how to write more.
# Usage: Put "source bash_completion_tmux.sh" into your .bashrc # Usage: Put "source bash_completion_tmux.sh" into your .bashrc
# Based upon the example at http://paste-it.appspot.com/Pj4mLycDE
_tmux_expand () _tmux_expand ()
{ {
@@ -185,4 +184,3 @@ _tmux() {
complete -F _tmux tmux complete -F _tmux tmux
# END tmux completion # END tmux completion

View File

@@ -1,70 +1,2 @@
# link: https://github.com/ginatrapani/todo.txt-cli/blob/master/todo_completion _log_warning 'Bash completion for "todo.txt-cli" is now deprecated, as it used code with incompatible license.
Please disable this completion and use the instructions from "todo.txt-cli" developers instead.'
_todo()
{
local cur prev opts
COMPREPLY=()
cur="${COMP_WORDS[COMP_CWORD]}"
prev="${COMP_WORDS[COMP_CWORD-1]}"
local -r OPTS="-@ -@@ -+ -++ -d -f -h -p -P -PP -a -n -t -v -vv -V -x"
local -r COMMANDS="\
add a addto addm append app archive command del \
rm depri dp do help list ls listaddons listall lsa listcon \
lsc listfile lf listpri lsp listproj lsprj move \
mv prepend prep pri p replace report shorthelp"
local -r MOVE_COMMAND_PATTERN='^(move|mv)$'
local _todo_sh=${_todo_sh:-todo.sh}
local completions
if [ $COMP_CWORD -eq 1 ]; then
completions="$COMMANDS $(eval TODOTXT_VERBOSE=0 $_todo_sh command listaddons) $OPTS"
elif [[ $COMP_CWORD -gt 2 && ( \
"${COMP_WORDS[COMP_CWORD-2]}" =~ $MOVE_COMMAND_PATTERN || \
"${COMP_WORDS[COMP_CWORD-3]}" =~ $MOVE_COMMAND_PATTERN ) ]]; then
completions=$(eval TODOTXT_VERBOSE=0 $_todo_sh command listfile)
else
case "$prev" in
command)
completions=$COMMANDS;;
help)
completions="$COMMANDS $(eval TODOTXT_VERBOSE=0 $_todo_sh command listaddons)";;
addto|listfile|lf)
completions=$(eval TODOTXT_VERBOSE=0 $_todo_sh command listfile);;
-*) completions="$COMMANDS $(eval TODOTXT_VERBOSE=0 $_todo_sh command listaddons) $OPTS";;
*) case "$cur" in
+*) completions=$(eval TODOTXT_VERBOSE=0 $_todo_sh command listproj)
COMPREPLY=( $( compgen -W "$completions" -- $cur ))
[ ${#COMPREPLY[@]} -gt 0 ] && return 0
completions=$(eval 'TODOTXT_VERBOSE=0 TODOTXT_SOURCEVAR=\$DONE_FILE' $_todo_sh command listproj)
;;
@*) completions=$(eval TODOTXT_VERBOSE=0 $_todo_sh command listcon)
COMPREPLY=( $( compgen -W "$completions" -- $cur ))
[ ${#COMPREPLY[@]} -gt 0 ] && return 0
completions=$(eval 'TODOTXT_VERBOSE=0 TODOTXT_SOURCEVAR=\$DONE_FILE' $_todo_sh command listcon)
;;
*) if [[ "$cur" =~ ^[0-9]+$ ]]; then
local todo=$( \
eval TODOTXT_VERBOSE=0 $_todo_sh '-@ -+ -p -x command ls "^ *${cur} "' | \
sed -e 's/^ *[0-9]\{1,\} //' -e 's/^\((.) \)\{0,1\}[0-9]\{2,4\}-[0-9]\{2\}-[0-9]\{2\} /\1/' \
-e 's/^\([xX] \)\([0-9]\{2,4\}-[0-9]\{2\}-[0-9]\{2\} \)\{1,2\}/\1/' \
-e 's/[[:space:]]*$//' \
-e '1q' \
)
[ "$todo" ] && COMPREPLY[0]="$cur # $todo"
return 0
else
return 0
fi
;;
esac
;;
esac
fi
COMPREPLY=( $( compgen -W "$completions" -- $cur ))
return 0
}
complete -F _todo todo.sh
complete -F _todo t

View File

@@ -1,51 +1,7 @@
# --------------------------------------------------------------------------- # shellcheck shell=bash
# vault-bash-completion cite "about-completion"
# about-completion "vault completion"
# This adds bash completions for [HashiCorp Vault](https://www.vaultproject.io/)
#
# see https://github.com/iljaweis/vault-bash-completion
# ---------------------------------------------------------------------------
function _vault_mounts() { if _binary_exists vault; then
( complete -C vault vault
set -euo pipefail fi
if ! vault mounts 2> /dev/null | awk 'NR > 1 {print $1}'; then
echo "secret"
fi
)
}
function _vault() {
local VAULT_COMMANDS=$(vault 2>&1 | egrep '^ +' | awk '{print $1}')
local cur
local prev
if [ $COMP_CWORD -gt 0 ]; then
cur=${COMP_WORDS[COMP_CWORD]}
prev=${COMP_WORDS[COMP_CWORD-1]}
fi
local line=${COMP_LINE}
if [[ $prev =~ ^(policies|policy-write|policy-delete) ]]; then
local policies=$(vault policies 2> /dev/null)
COMPREPLY=($(compgen -W "$policies" -- $cur))
elif [ "$(echo $line | wc -w)" -le 2 ]; then
if [[ "$line" =~ ^vault\ (read|write|delete|list)\ $ ]]; then
COMPREPLY=($(compgen -W "$(_vault_mounts)" -- ''))
else
COMPREPLY=($(compgen -W "$VAULT_COMMANDS" -- $cur))
fi
elif [[ "$line" =~ ^vault\ (read|write|delete|list)\ (.*)$ ]]; then
path=${BASH_REMATCH[2]}
if [[ "$path" =~ ^([^ ]+)/([^ /]*)$ ]]; then
list=$(vault list -format=yaml ${BASH_REMATCH[1]} 2> /dev/null | awk '{ print $2 }')
COMPREPLY=($(compgen -W "$list" -P "${BASH_REMATCH[1]}/" -- ${BASH_REMATCH[2]}))
else
COMPREPLY=($(compgen -W "$(_vault_mounts)" -- $path))
fi
fi
}
complete -o default -o nospace -F _vault vault

View File

@@ -1,148 +1,2 @@
#!/usr/bin/env bash _log_warning 'Bash completion for "virsh" is now deprecated, as it used code with incompatible license.
# bash completion for virsh - main CLI of libvirt Please disable this completion and use the instructions from "virsh" developers instead.'
# This script provides bash completion for virsh,
# borrowed from https://github.com/LuyaoHuang/virsh-bash-completion
_contain_cmd()
{
local e f
local array1=($1) array2=($2)
for e in "${array1[@]}"
do
for f in "${array2[@]}"
do
if [[ "$e" == "$f" ]] ; then
echo $e
return
fi
done
done
echo "notfound"
return
}
_virsh_list_networks()
{
local flag_all=$1 flags
if [ "$flag_all" -eq 1 ]; then
flags="--all"
else
flags="--inactive"
fi
virsh -q net-list $flags | cut -d\ -f2 | awk '{print $1}'
}
_virsh_list_domains()
{
local flag_all=$1 flags
if [ "$flag_all" -eq 1 ]; then
flags="--all"
else
flags="--inactive"
fi
virsh -q list $flags | cut -d\ -f7 | awk '{print $1}'
}
_virsh_list_pools()
{
local flag_all=$1 flags
if [ "$flag_all" -eq 1 ]; then
flags="--all"
else
flags="--inactive"
fi
virsh -q pool-list $flags | cut -d\ -f2 | awk '{print $1}'
}
_virsh_list_ifaces()
{
local flag_all=$1 flags
if [ "$flag_all" -eq 1 ]; then
flags="--all"
else
flags="--inactive"
fi
virsh -q iface-list $flags | cut -d\ -f2 | awk '{print $1}'
}
_virsh_list_nwfilters()
{
virsh -q nwfilter-list | cut -d\ -f4 | awk '{print $1}'
}
_virsh()
{
local cur prev cmds doms options nets pools cmds_help
local flag_all=1 array ret a b ifaces nwfilters files
# not must use bash-completion now :)
# _init_completion -s || return
COMPREPLY=()
cur="${COMP_WORDS[COMP_CWORD]}"
prev="${COMP_WORDS[COMP_CWORD-1]}"
cmds=$( echo "$(virsh -h| grep '^ ' | cut -d\ -f5)" \
"$(virsh -h| grep '\--' | cut -d\ -f7 | cut -d= -f1)")
cmds_help=$(virsh help| grep '^ ' | cut -d\ -f5)
case "$prev" in
--domain)
doms=$(_virsh_list_domains "$flag_all")
COMPREPLY=( $(compgen -W "$doms" -- "$cur") )
return 0
;;
--network)
nets=$(_virsh_list_networks "$flag_all")
COMPREPLY=( $(compgen -W "$nets" -- "$cur") )
return 0
;;
--pool)
pools=$(_virsh_list_pools "$flag_all")
COMPREPLY=( $(compgen -W "$pools" -- "$cur") )
return 0
;;
--interface)
ifaces=$(_virsh_list_ifaces "$flag_all")
COMPREPLY=( $(compgen -W "$ifaces" -- "$cur") )
return 0
;;
--nwfilter)
nwfilters=$(_virsh_list_nwfilters)
COMPREPLY=( $(compgen -W "$nwfilters" -- "$cur") )
return 0
;;
--file|--xml)
files=$(ls)
COMPREPLY=( $(compgen -W "$files" -- "$cur") )
return 0
;;
esac
array=$(IFS=$'\n'; echo "${COMP_WORDS[*]}")
ret=$(_contain_cmd "$array" "$cmds_help")
if [[ "$ret" != "notfound" && "$ret" != "$cur" ]]; then
a=$(virsh help "$ret" |grep '^ --'|cut -d\ -f5)
b=$(virsh help "$ret" |grep '^ \[--'|cut -d\ -f5|cut -d[ -f2|cut -d] -f1)
options=$( echo $a $b )
COMPREPLY=( $(compgen -W "$options" -- "$cur") )
return 0
fi
case "$cur" in
*)
COMPREPLY=( $(compgen -W "$cmds" -- "$cur") )
return 0
;;
esac
} &&
complete -o default -F _virsh virsh

View File

@@ -10,30 +10,30 @@ __vboxmanage_startvm() {
AVAILABLE="" AVAILABLE=""
for VM in $TOTAL; do for VM in $TOTAL; do
MATCH=0; MATCH=0;
for RUN in $RUNNING "x"; do for RUN in $RUNNING "x"; do
if [ "$VM" == "$RUN" ]; then if [ "$VM" == "$RUN" ]; then
MATCH=1 MATCH=1
fi fi
done done
(( $MATCH == 0 )) && AVAILABLE="$AVAILABLE $VM " (( $MATCH == 0 )) && AVAILABLE="$AVAILABLE $VM "
done done
echo $AVAILABLE echo $AVAILABLE
} }
__vboxmanage_list() { __vboxmanage_list() {
INPUT=$(vboxmanage list | tr -s '[\[\]\|\n]' ' ' | cut -d' ' -f4-) INPUT=$(vboxmanage list | tr -s '[\[\]\|\n]' ' ' | cut -d' ' -f4-)
PRUNED="" PRUNED=""
if [ "$1" == "long" ]; then if [ "$1" == "long" ]; then
for WORD in $INPUT; do for WORD in $INPUT; do
[ "$WORD" == "-l" ] && continue; [ "$WORD" == "-l" ] && continue;
[ "$WORD" == "--long" ] && continue; [ "$WORD" == "--long" ] && continue;
PRUNED="$PRUNED $WORD" PRUNED="$PRUNED $WORD"
done done
else else
PRUNED=$INPUT PRUNED=$INPUT
fi fi
echo $PRUNED echo $PRUNED
@@ -43,14 +43,14 @@ __vboxmanage_list() {
__vboxmanage_list_vms() { __vboxmanage_list_vms() {
VMS="" VMS=""
if [ "x$1" == "x" ]; then if [ "x$1" == "x" ]; then
SEPARATOR=" " SEPARATOR=" "
else else
SEPARATOR=$1 SEPARATOR=$1
fi fi
for VM in $(vboxmanage list vms | cut -d' ' -f1 | tr -d '"'); do for VM in $(vboxmanage list vms | cut -d' ' -f1 | tr -d '"'); do
[ "$VMS" != "" ] && VMS="${VMS}${SEPARATOR}" [ "$VMS" != "" ] && VMS="${VMS}${SEPARATOR}"
VMS="${VMS}${VM}" VMS="${VMS}${VM}"
done done
echo $VMS echo $VMS
@@ -59,14 +59,14 @@ __vboxmanage_list_vms() {
__vboxmanage_list_runningvms() { __vboxmanage_list_runningvms() {
VMS="" VMS=""
if [ "$1" == "" ]; then if [ "$1" == "" ]; then
SEPARATOR=" " SEPARATOR=" "
else else
SEPARATOR=$1 SEPARATOR=$1
fi fi
for VM in $(vboxmanage list runningvms | cut -d' ' -f1 | tr -d '"'); do for VM in $(vboxmanage list runningvms | cut -d' ' -f1 | tr -d '"'); do
[ "$VMS" != "" ] && VMS="${VMS}${SEPARATOR}" [ "$VMS" != "" ] && VMS="${VMS}${SEPARATOR}"
VMS="${VMS}${VM}" VMS="${VMS}${VM}"
done done
echo $VMS echo $VMS
@@ -81,7 +81,7 @@ __vboxmanage_controlvm() {
echo "screenshotpng setcredentials teleport plugcpu unplugcpu" echo "screenshotpng setcredentials teleport plugcpu unplugcpu"
echo "cpuexecutioncap" echo "cpuexecutioncap"
# setlinkstate<1-N> # setlinkstate<1-N>
# nic<1-N> null|nat|bridged|intnet|hostonly|generic # nic<1-N> null|nat|bridged|intnet|hostonly|generic
# [<devicename>] | # [<devicename>] |
# nictrace<1-N> on|off # nictrace<1-N> on|off
@@ -102,43 +102,43 @@ __vboxmanage_default() {
# echo "DEBUG: cur: $cur, prev: $prev" # echo "DEBUG: cur: $cur, prev: $prev"
# echo "DEBUG: default: |$p1|$p2|$p3|$p4|" # echo "DEBUG: default: |$p1|$p2|$p3|$p4|"
case ${cur} in case ${cur} in
-*) -*)
echo $opts echo $opts
# COMPREPLY=($(compgen -W "${opts}" -- ${cur})) # COMPREPLY=($(compgen -W "${opts}" -- ${cur}))
return 0 return 0
;; ;;
esac; esac;
for WORD in $opts; do for WORD in $opts; do
MATCH=0 MATCH=0
for OPT in "${COMP_WORDS[@]}"; do for OPT in "${COMP_WORDS[@]}"; do
# opts=$(echo ${opts} | grep -v $OPT); # opts=$(echo ${opts} | grep -v $OPT);
if [ "$OPT" == "$WORD" ]; then if [ "$OPT" == "$WORD" ]; then
MATCH=1 MATCH=1
break; break;
fi fi
if [ "$OPT" == "-v" ] && [ "$WORD" == "--version" ]; then if [ "$OPT" == "-v" ] && [ "$WORD" == "--version" ]; then
MATCH=1 MATCH=1
break; break;
fi fi
if [ "$OPT" == "--version" ] && [ "$WORD" == "-v" ]; then if [ "$OPT" == "--version" ] && [ "$WORD" == "-v" ]; then
MATCH=1 MATCH=1
break; break;
fi fi
if [ "$OPT" == "-q" ] && [ "$WORD" == "--nologo" ]; then if [ "$OPT" == "-q" ] && [ "$WORD" == "--nologo" ]; then
MATCH=1 MATCH=1
break; break;
fi fi
if [ "$OPT" == "--nologo" ] && [ "$WORD" == "-q" ]; then if [ "$OPT" == "--nologo" ] && [ "$WORD" == "-q" ]; then
MATCH=1 MATCH=1
break; break;
fi fi
done
(( $MATCH == 1 )) && continue;
pruned="$pruned $WORD"
done done
(( $MATCH == 1 )) && continue;
pruned="$pruned $WORD"
done
# COMPREPLY=($(compgen -W "${pruned}" -- ${cur})) # COMPREPLY=($(compgen -W "${pruned}" -- ${cur}))
echo $pruned echo $pruned
return 0 return 0
@@ -156,65 +156,65 @@ _vboxmanage() {
# In case current is complete command # In case current is complete command
case $cur in case $cur in
startvm|list|controlvm) startvm|list|controlvm)
COMPREPLY=($(compgen -W "$cur ")) COMPREPLY=($(compgen -W "$cur "))
return 0 return 0
;; ;;
esac esac
case $prev in case $prev in
-v|--version) -v|--version)
return 0 return 0
;; ;;
-l|--long) -l|--long)
opts=$(__vboxmanage_list "long") opts=$(__vboxmanage_list "long")
COMPREPLY=($(compgen -W "${opts}" -- ${cur})) COMPREPLY=($(compgen -W "${opts}" -- ${cur}))
return 0 return 0
;; ;;
startvm|list) startvm|list)
opts=$(__vboxmanage_$prev) opts=$(__vboxmanage_$prev)
COMPREPLY=($(compgen -W "${opts}" -- ${cur})) COMPREPLY=($(compgen -W "${opts}" -- ${cur}))
return 0 return 0
;; ;;
--type) --type)
COMPREPLY=($(compgen -W "gui headless" -- ${cur})) COMPREPLY=($(compgen -W "gui headless" -- ${cur}))
return 0 return 0
;; ;;
gui|headless) gui|headless)
# Done. no more completion possible # Done. no more completion possible
return 0 return 0
;; ;;
vboxmanage|-q|--nologo) vboxmanage|-q|--nologo)
# echo "Got vboxmanage" # echo "Got vboxmanage"
opts=$(__vboxmanage_default) opts=$(__vboxmanage_default)
COMPREPLY=($(compgen -W "${opts}" -- ${cur})) COMPREPLY=($(compgen -W "${opts}" -- ${cur}))
return 0 return 0
;; ;;
controlvm) controlvm)
opts=$(__vboxmanage_list_vms) opts=$(__vboxmanage_list_vms)
COMPREPLY=($(compgen -W "${opts}" -- ${cur})) COMPREPLY=($(compgen -W "${opts}" -- ${cur}))
return 0 return 0
;; ;;
esac esac
for VM in $(__vboxmanage_list_vms); do for VM in $(__vboxmanage_list_vms); do
if [ "$VM" == "$prev" ]; then if [ "$VM" == "$prev" ]; then
pprev=${COMP_WORDS[COMP_CWORD-2]} pprev=${COMP_WORDS[COMP_CWORD-2]}
# echo "previous: $pprev" # echo "previous: $pprev"
case $pprev in case $pprev in
startvm) startvm)
opts="--type" opts="--type"
COMPREPLY=($(compgen -W "${opts}" -- ${cur})) COMPREPLY=($(compgen -W "${opts}" -- ${cur}))
return 0 return 0
;; ;;
controlvm) controlvm)
opts=$(__vboxmanage_controlvm) opts=$(__vboxmanage_controlvm)
COMPREPLY=($(compgen -W "${opts}" -- ${cur})) COMPREPLY=($(compgen -W "${opts}" -- ${cur}))
return 0; return 0;
;; ;;
esac esac
fi fi
done done
# echo "Got to end withoug completion" # echo "Got to end withoug completion"

View File

@@ -1,15 +1,59 @@
#!/usr/bin/bash # shellcheck shell=bash
if command -v vue > /dev/null; then __vuejs_completion() {
__vuejs_completion() { local prev=$(_get_pword)
local OPTS=("--version --help create add invoke inspect serve build ui init config upgrade info") local curr=$(_get_cword)
COMPREPLY=()
for _opt_ in ${OPTS[@]}; do case $prev in
if [[ "$_opt_" == "$2"* ]]; then create)
COMPREPLY+=("$_opt_") # shellcheck disable=SC2207
fi COMPREPLY=($(compgen -W "-p -d -i -m -r -g -n -f -c -x -b -h --help --preset --default --inilinePreset --packageManager --registry --git --no-git --force --merge --clone --proxy --bare --skipGetStarted" -- "$curr"))
done ;;
} add | invoke)
# shellcheck disable=SC2207
complete -F __vuejs_completion vue COMPREPLY=($(compgen -W "--registry -h --help" -- "$curr"))
fi ;;
inspect)
# shellcheck disable=SC2207
COMPREPLY=($(compgen -W "-v --help --verbose --mode --rule --plugin --plugins --rules" -- "$curr"))
;;
serve)
# shellcheck disable=SC2207
COMPREPLY=($(compgen -W "-o -h --help --open -c --copy -p --port" -- "$curr"))
;;
build)
# shellcheck disable=SC2207
COMPREPLY=($(compgen -W "-t --target -n --name -d --dest -h --help" -- "$curr"))
;;
ui)
# shellcheck disable=SC2207
COMPREPLY=($(compgen -W "-H --host -p --port -D --dev --quiet --headless -h --help" -- "$curr"))
;;
init)
# shellcheck disable=SC2207
COMPREPLY=($(compgen -W "-c --clone --offline -h --help" -- "$curr"))
;;
config)
# shellcheck disable=SC2207
COMPREPLY=($(compgen -W "-g --get -s --set -d --delete -e --edit --json -h --help" -- "$curr"))
;;
outdated)
# shellcheck disable=SC2207
COMPREPLY=($(compgen -W "--next -h --help" -- "$curr"))
;;
upgrade)
# shellcheck disable=SC2207
COMPREPLY=($(compgen -W "-t --to -f --from -r --registry --all --next -h --help" -- "$curr"))
;;
migrate)
# shellcheck disable=SC2207
COMPREPLY=($(compgen -W "-f --from -h --help" -- "$curr"))
;;
*)
# shellcheck disable=SC2207
COMPREPLY=($(compgen -W "-h --help -v --version create add invoke inspect serve build ui init config outdated upgrade migrate info" -- "$curr"))
;;
esac
}
complete -F __vuejs_completion vue

View File

@@ -1,16 +1,15 @@
#!/usr/bin/bash # shellcheck shell=bash
if command -v wpscan > /dev/null; then if command -v wpscan > /dev/null; then
__wpscan_completion() { __wpscan_completion() {
local OPTS=("--help --hh --version --url --ignore-main-redirect --verbose --output --format --detection-mode --scope --headers --user-agent --vhost --random-user-agent --user-agents-list --http-auth --max-threads --throttle --request-timeout --connect-timeout --disable-tlc-checks --proxy --proxy-auth --cookie-string --cookie-jar --cache-ttl --clear-cache --server --cache-dir --update --no-update --wp-content-dir --wp-plugins-dir --wp-version-detection --main-theme-detection --enumerate --exclude-content-based --plugins-list --plugins-detection --plugins-version-all --plugins-version-detection --themes-list --themes-detection --themes-version-all --themes-version-detection --timthumbs-list --timthumbs-detection --config-backups-list --config-backups-detection --db-exports-list --db-exports-detection --medias-detection --users-list --users-detection --passwords --usernames --multicall-max-passwords --password-attack --stealthy") local OPTS=("--help --hh --version --url --ignore-main-redirect --verbose --output --format --detection-mode --scope --headers --user-agent --vhost --random-user-agent --user-agents-list --http-auth --max-threads --throttle --request-timeout --connect-timeout --disable-tlc-checks --proxy --proxy-auth --cookie-string --cookie-jar --cache-ttl --clear-cache --server --cache-dir --update --no-update --wp-content-dir --wp-plugins-dir --wp-version-detection --main-theme-detection --enumerate --exclude-content-based --plugins-list --plugins-detection --plugins-version-all --plugins-version-detection --themes-list --themes-detection --themes-version-all --themes-version-detection --timthumbs-list --timthumbs-detection --config-backups-list --config-backups-detection --db-exports-list --db-exports-detection --medias-detection --users-list --users-detection --passwords --usernames --multicall-max-passwords --password-attack --stealthy")
COMPREPLY=() COMPREPLY=()
for _opt_ in ${OPTS[@]}; do for _opt_ in "${OPTS[@]}"; do
if [[ "$_opt_" == "$2"* ]]; then if [[ "$_opt_" == "$2"* ]]; then
COMPREPLY+=("$_opt_") COMPREPLY+=("$_opt_")
fi fi
done done
} }
complete -F __wpscan_completion wpscan
fi
complete -F __wpscan_completion wpscan
fi

20
docs/Makefile Normal file
View File

@@ -0,0 +1,20 @@
# Minimal makefile for Sphinx documentation
#
# You can set these variables from the command line, and also
# from the environment for the first two.
SPHINXOPTS ?=
SPHINXBUILD ?= sphinx-build
SOURCEDIR = .
BUILDDIR = _build
# Put it first so that "make" without argument is like "make help".
help:
@$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
.PHONY: help Makefile
# Catch-all target: route all unknown targets to Sphinx using the new
# "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS).
%: Makefile
@$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)

64
docs/README.md Normal file
View File

@@ -0,0 +1,64 @@
![logo](https://github.com/Bash-it/media/raw/master/media/Bash-it.png)
![Build Status](https://github.com/Bash-it/bash-it/workflows/CI/badge.svg?branch=master)
![Docs Status](https://readthedocs.org/projects/bash-it/badge/)
![License](https://img.shields.io/github/license/Bash-it/bash-it)
![shell](https://img.shields.io/badge/Shell-Bash-blue)
[![Join the chat at https://web.libera.chat/?channel=#bash-it](https://img.shields.io/badge/chat-on%20Libera.Chat-brightgreen.svg)](https://web.libera.chat/?channel=#bash-it)
**Bash-it** is a collection of community Bash commands and scripts for Bash 3.2+.
(And a shameless ripoff of [oh-my-zsh](https://github.com/robbyrussell/oh-my-zsh) :smiley:)
Includes autocompletion, themes, aliases, custom functions, a few stolen pieces from Steve Losh, and more.
Bash-it provides a solid framework for using, developing and maintaining shell scripts and custom commands for your daily work.
If you're using the _Bourne Again Shell_ (Bash) regularly and have been looking for an easy way on how to keep all of these nice little scripts and aliases under control, then Bash-it is for you!
Stop polluting your `~/bin` directory and your `.bashrc` file, fork/clone Bash-it and start hacking away.
- [Main Page](https://bash-it.readthedocs.io/en/latest)
- [Contributing](#contributing)
- [Installation](#installation)
- [Install Options](https://bash-it.readthedocs.io/en/latest/installation/#install-options)
- [via Docker](https://bash-it.readthedocs.io/en/latest/installation/#install-using-docker)
- [Updating](https://bash-it.readthedocs.io/en/latest/installation/#updating)
- [Help](https://bash-it.readthedocs.io/en/latest/misc/#help-screens)
- [Search](https://bash-it.readthedocs.io/en/latest/commands/search)
- [Syntax](https://bash-it.readthedocs.io/en/latest/commands/search/#syntax)
- [Searching with Negations](
https://bash-it.readthedocs.io/en/latest/commands/search/#searching-with-negations)
- [Using Search to Enable or Disable Components](https://bash-it.readthedocs.io/en/latest/commands/search/#using-search-to-enable-or-disable-components)
- [Disabling ASCII Color](https://bash-it.readthedocs.io/en/latest/commands/search/#disabling-ascii-color)
- [Custom scripts, aliases, themes, and functions](
https://bash-it.readthedocs.io/en/latest/custom)
- [Themes](https://bash-it.readthedocs.io/en/latest/themes)
- [Uninstalling](https://bash-it.readthedocs.io/en/latest/uninstalling)
- [Misc](https://bash-it.readthedocs.io/en/latest/misc)
- [Help Out](https://bash-it.readthedocs.io/en/latest/#help-out)
- [Contributors](#contributors)
## Installation
1) Check out a clone of this repo to a location of your choice, such as
``git clone --depth=1 https://github.com/Bash-it/bash-it.git ~/.bash_it``
2) Run ``~/.bash_it/install.sh``
That's it! :smiley:
You can check out more components of Bash-it, and customize it to your desire.
For more information, see detailed instructions [here](https://bash-it.readthedocs.io/en/latest/installation/).
## Contributing
Please take a look at the [Contribution Guidelines](https://bash-it.readthedocs.io/en/latest/contributing) before reporting a bug or providing a new feature.
The [Development Guidelines](https://bash-it.readthedocs.io/en/latest/development) have more information on some of the internal workings of Bash-it,
please feel free to read through this page if you're interested in how Bash-it loads its components.
## Contributors
[List of contributors](https://github.com/Bash-it/bash-it/contributors)
## License
Bash-it is licensed under the [MIT License](https://github.com/Bash-it/bash-it/blob/master/LICENSE).

0
docs/_static/.keep vendored Normal file
View File

0
docs/_templates/.keep vendored Normal file
View File

20
docs/commands/doctor.rst Normal file
View File

@@ -0,0 +1,20 @@
.. _doctor:
Bash-it doctor
^^^^^^^^^^^^^^
If you encounter problems with any part of Bash-it, run the following command:
.. code-block:: bash
bash-it doctor
This will reload your bash profile and print out logs of various parts in Bash-it.
Note that this command at default will print all logs, including debug logs.
You can call it like this:
.. code-block:: bash
bash-it doctor [errors/warnings/all]
In order to get wanted verbosity.

15
docs/commands/index.rst Normal file
View File

@@ -0,0 +1,15 @@
.. _commands:
Bash-it Commands
================
**Bash-it** boasts a wide range of available commands.
You should be familiar with them in order to fully utilize Bash-it.
.. toctree::
:maxdepth: 1
update
search
reload
doctor

23
docs/commands/reload.rst Normal file
View File

@@ -0,0 +1,23 @@
.. _reload:
Bash-it reload
^^^^^^^^^^^^^^
Bash-it creates a ``reload`` alias that makes it convenient to reload
your Bash profile when you make changes.
Additionally, if you export ``BASH_IT_AUTOMATIC_RELOAD_AFTER_CONFIG_CHANGE`` as a non-null value,
Bash-it will automatically reload itself after activating or deactivating plugins, aliases, or completions.
.. warning::
When changing theme, do not use ``bash-it reload``. Instead, use :ref:`restart`.
.. _restart:
Bash-it restart
^^^^^^^^^^^^^^^
Similar to :ref:`reload`, ``bash-it restart`` can be used to restart your shell.
Instead of reloading your Bash profile, this command re-runs Bash (using exec).
This is stronger than simple reload, and is similar to the effect of closing and reopening your terminal.

59
docs/commands/search.rst Normal file
View File

@@ -0,0 +1,59 @@
.. _searching:
Bash-it search
--------------
If you need to quickly find out which of the plugins, aliases or completions are available for a specific framework, programming language, or an environment, you can *search* for multiple terms related to the commands you use frequently.
Search will find and print out modules with the name or description matching the terms provided.
Syntax
^^^^^^
.. code-block:: bash
bash-it search term1 [[-]term2] [[-]term3]....
As an example, a ruby developer might want to enable everything related to the commands such as ``ruby``\ , ``rake``\ , ``gem``\ , ``bundler``\ , and ``rails``.
Search command helps you find related modules so that you can decide which of them you'd like to use:
.. code-block:: bash
bash-it search ruby rake gem bundle irb rails
aliases: bundler rails
plugins: chruby chruby-auto ruby
completions: bundler gem rake
Currently enabled modules will be shown in green.
Searching with Negations
^^^^^^^^^^^^^^^^^^^^^^^^
You can prefix a search term with a "-" to exclude it from the results.
In the above example, if we wanted to hide ``chruby`` and ``chruby-auto``\ ,
we could change the command as follows:
.. code-block:: bash
bash-it search ruby rake gem bundle irb rails -chruby
aliases: bundler rails
plugins: ruby
completions: bundler gem rake
Using Search to Enable or Disable Components
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
By adding a ``--enable`` or ``--disable`` to the search command, you can automatically enable all modules that come up as a result of a search query.
This could be quite handy if you like to enable a bunch of components related to the same topic.
Disabling ASCII Color
^^^^^^^^^^^^^^^^^^^^^
To remove non-printing non-ASCII characters responsible for the coloring of the search output, you can set environment variable ``NO_COLOR``.
Enabled components will then be shown with a checkmark:
.. code-block:: bash
NO_COLOR=1 bash-it search ruby rake gem bundle irb rails -chruby
aliases => ✓bundler ✓rails
plugins => ✓ruby
completions => bundler gem rake

38
docs/commands/update.rst Normal file
View File

@@ -0,0 +1,38 @@
.. _update:
Bash-it update
^^^^^^^^^^^^^^
To update Bash-it to the latest stable version, simply run:
.. code-block:: bash
bash-it update stable
If you want to update to the latest dev version (directly from master), run:
.. code-block:: bash
bash-it update dev
If you want to update automatically and unattended, you can add the optional
``-s/--silent`` flag, for example:
.. code-block:: bash
bash-it update dev --silent
.. _migrate:
Bash-it migrate
^^^^^^^^^^^^^^^
If you are using an older version of Bash-it, it's possible that some functionality has changed, or that the internal structure of how Bash-it organizes its functionality has been updated.
For these cases, we provide a ``migrate`` command:
.. code-block:: bash
bash-it migrate
This command will automatically migrate the Bash-it structure to the latest version.
The ``migrate`` command is run automatically if you run the ``update``\ , ``enable`` or ``disable`` commands.

57
docs/conf.py Normal file
View File

@@ -0,0 +1,57 @@
# Configuration file for the Sphinx documentation builder.
#
# This file only contains a selection of the most common options. For a full
# list see the documentation:
# https://www.sphinx-doc.org/en/master/usage/configuration.html
# -- Path setup --------------------------------------------------------------
# If extensions (or modules to document with autodoc) are in another directory,
# add these directories to sys.path here. If the directory is relative to the
# documentation root, use os.path.abspath to make it absolute, like shown here.
#
# import os
# import sys
# sys.path.insert(0, os.path.abspath('.'))
# -- Project information -----------------------------------------------------
project = 'Bash-it'
copyright = '2020, Bash-it Team'
author = 'Bash-it Team'
# The full version, including alpha/beta/rc tags
release = ''
# -- General configuration ---------------------------------------------------
# Add any Sphinx extension module names here, as strings. They can be
# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
# ones.
extensions = [
'sphinx_rtd_theme',
'sphinxemoji.sphinxemoji',
]
# Add any paths that contain templates here, relative to this directory.
templates_path = ['_templates']
# List of patterns, relative to source directory, that match files and
# directories to ignore when looking for source files.
# This pattern also affects html_static_path and html_extra_path.
exclude_patterns = ['_build', 'Thumbs.db', '.DS_Store']
# -- Options for HTML output -------------------------------------------------
# The theme to use for HTML and HTML Help pages. See the documentation for
# a list of builtin themes.
#
html_theme = 'sphinx_rtd_theme'
# Add any paths that contain custom static files (such as style sheets) here,
# relative to this directory. They are copied after the builtin static files,
# so a file named "default.css" will overwrite the builtin "default.css".
html_static_path = ['_static']

Some files were not shown because too many files have changed in this diff Show More