* CI: disable Ubuntu 16.04 as it's EOL https://github.blog/changelog/2021-04-29-github-actions-ubuntu-16-04-lts-virtual-environment-will-be-removed-on-september-20-2021/ * main: lint false positive * install: lint * plugins/cmd-returned-notify: don't `export` * plugins/xterm: lint * plugins/git: lint * plugins/goenv: lint * plugins/alias-completion: lint false positives * plugins/alias-completion: fix SC2155, SC2154 Declare `locals` at the top of the function * completion: lint completions using `bash_completion` functions Match the style of the existing code * completion/knife: lint false positives * completion/knife: lint * completion/sdkman: lint * completion/composer: lint * Move `.shellcheckrc` under `themes/` * lib/theme: fix SC2155, SC2154, SC2034 * lib/colors: don't warn on unused variables We assign a large number of variables here and they may or may not be used anywhere else, so disable SC2034 for this file (only). Alsö disable SC2005 as the functions in this file were written before `printf` was invented and have to do some fancy metascripting to get escape sequences interpreted reliably. I’m not smart enough to fix this to use `printf`, so leave it for now. * themes/agnoster: lint * themes: disable SC2154 for colors Each one of these themes will need it’s own fix for SC2154, possibly upstream. Due to the way themes are, it's entirely normal to have a *lot* of false positives for SC2034. So much so, that I have to admit that it is probably just not worth linting for SC2034 despite my dislike of blanket ignore rules. * themes: disable SC2154, fix SC2155 Each one of these themes will need it’s own fix for SC2154, possibly upstream. Due to the way themes are, it's entirely normal to have a *lot* of false positives for SC2034. So much so, that I have to admit that it is probably just not worth linting for SC2034 despite my dislike of blanket ignore rules. * Delete `.shellcheckrc` * remove executable bit
48 lines
1.2 KiB
Bash
48 lines
1.2 KiB
Bash
# shellcheck shell=bash
|
|
|
|
__ngrok_completion() {
|
|
# shellcheck disable=SC2155
|
|
local prev=$(_get_pword)
|
|
# shellcheck disable=SC2155
|
|
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
|