Fix shellcheck warnings for pihole bash completion
Signed-off-by: Christian König <github@yubiuser.dev>
This commit is contained in:
@@ -1,3 +1,7 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
#
|
||||||
|
# Bash completion script for pihole
|
||||||
|
#
|
||||||
_pihole() {
|
_pihole() {
|
||||||
local cur prev opts opts_lists opts_checkout opts_debug opts_logging opts_query opts_update opts_networkflush
|
local cur prev opts opts_lists opts_checkout opts_debug opts_logging opts_query opts_update opts_networkflush
|
||||||
COMPREPLY=()
|
COMPREPLY=()
|
||||||
@@ -8,40 +12,40 @@ _pihole() {
|
|||||||
case "${prev}" in
|
case "${prev}" in
|
||||||
"pihole")
|
"pihole")
|
||||||
opts="allow allow-regex allow-wild deny checkout debug disable enable flush help logging query repair regex reloaddns reloadlists setpassword status tail uninstall updateGravity updatePihole version wildcard networkflush api"
|
opts="allow allow-regex allow-wild deny checkout debug disable enable flush help logging query repair regex reloaddns reloadlists setpassword status tail uninstall updateGravity updatePihole version wildcard networkflush api"
|
||||||
COMPREPLY=( $(compgen -W "${opts}" -- ${cur}) )
|
mapfile -t COMPREPLY < <(compgen -W "${opts}" -- "${cur}")
|
||||||
;;
|
;;
|
||||||
"allow"|"deny"|"wildcard"|"regex"|"allow-regex"|"allow-wild")
|
"allow"|"deny"|"wildcard"|"regex"|"allow-regex"|"allow-wild")
|
||||||
opts_lists="\not \--delmode \--quiet \--list \--help"
|
opts_lists="\not \--delmode \--quiet \--list \--help"
|
||||||
COMPREPLY=( $(compgen -W "${opts_lists}" -- ${cur}) )
|
mapfile -t COMPREPLY < <(compgen -W "${opts_lists}" -- "${cur}")
|
||||||
;;
|
;;
|
||||||
"checkout")
|
"checkout")
|
||||||
opts_checkout="core ftl web master dev"
|
opts_checkout="core ftl web master dev"
|
||||||
COMPREPLY=( $(compgen -W "${opts_checkout}" -- ${cur}) )
|
mapfile -t COMPREPLY < <(compgen -W "${opts_checkout}" -- "${cur}")
|
||||||
;;
|
;;
|
||||||
"debug")
|
"debug")
|
||||||
opts_debug="-a"
|
opts_debug="-a"
|
||||||
COMPREPLY=( $(compgen -W "${opts_debug}" -- ${cur}) )
|
mapfile -t COMPREPLY < <(compgen -W "${opts_debug}" -- "${cur}")
|
||||||
;;
|
;;
|
||||||
"logging")
|
"logging")
|
||||||
opts_logging="on off 'off noflush'"
|
opts_logging="on off 'off noflush'"
|
||||||
COMPREPLY=( $(compgen -W "${opts_logging}" -- ${cur}) )
|
mapfile -t COMPREPLY < <(compgen -W "${opts_logging}" -- "${cur}")
|
||||||
;;
|
;;
|
||||||
"query")
|
"query")
|
||||||
opts_query="--partial --all"
|
opts_query="--partial --all"
|
||||||
COMPREPLY=( $(compgen -W "${opts_query}" -- ${cur}) )
|
mapfile -t COMPREPLY < <(compgen -W "${opts_query}" -- "${cur}")
|
||||||
;;
|
;;
|
||||||
"updatePihole"|"-up")
|
"updatePihole"|"-up")
|
||||||
opts_update="--check-only"
|
opts_update="--check-only"
|
||||||
COMPREPLY=( $(compgen -W "${opts_update}" -- ${cur}) )
|
mapfile -t COMPREPLY < <(compgen -W "${opts_update}" -- "${cur}")
|
||||||
;;
|
;;
|
||||||
"networkflush")
|
"networkflush")
|
||||||
opts_networkflush="--arp"
|
opts_networkflush="--arp"
|
||||||
COMPREPLY=( $(compgen -W "${opts_networkflush}" -- ${cur}) )
|
mapfile -t COMPREPLY < <(compgen -W "${opts_networkflush}" -- "${cur}")
|
||||||
;;
|
;;
|
||||||
"core"|"web"|"ftl")
|
"core"|"web"|"ftl")
|
||||||
if [[ "$prev2" == "checkout" ]]; then
|
if [[ "$prev2" == "checkout" ]]; then
|
||||||
opts_checkout="master development"
|
opts_checkout="master development"
|
||||||
COMPREPLY=( $(compgen -W "${opts_checkout}" -- ${cur}) )
|
mapfile -t COMPREPLY < <(compgen -W "${opts_checkout}" -- "${cur}")
|
||||||
else
|
else
|
||||||
return 1
|
return 1
|
||||||
fi
|
fi
|
||||||
@@ -1137,7 +1137,7 @@ installScripts() {
|
|||||||
install -o "${USER}" -Dm755 -t "${PI_HOLE_INSTALL_DIR}" ./automated\ install/uninstall.sh
|
install -o "${USER}" -Dm755 -t "${PI_HOLE_INSTALL_DIR}" ./automated\ install/uninstall.sh
|
||||||
install -o "${USER}" -Dm755 -t "${PI_HOLE_INSTALL_DIR}" ./advanced/Scripts/COL_TABLE
|
install -o "${USER}" -Dm755 -t "${PI_HOLE_INSTALL_DIR}" ./advanced/Scripts/COL_TABLE
|
||||||
install -o "${USER}" -Dm755 -t "${PI_HOLE_BIN_DIR}" pihole
|
install -o "${USER}" -Dm755 -t "${PI_HOLE_BIN_DIR}" pihole
|
||||||
install -Dm644 ./advanced/bash-completion/pihole /etc/bash_completion.d/pihole
|
install -Dm644 ./advanced/bash-completion/pihole.bash /etc/bash_completion.d/pihole
|
||||||
install -Dm644 ./advanced/bash-completion/pihole-ftl.bash /etc/bash_completion.d/pihole-FTL
|
install -Dm644 ./advanced/bash-completion/pihole-ftl.bash /etc/bash_completion.d/pihole-FTL
|
||||||
printf "%b %b %s\\n" "${OVER}" "${TICK}" "${str}"
|
printf "%b %b %s\\n" "${OVER}" "${TICK}" "${str}"
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user