Rename option --admin to --web in version function

Signed-off-by: Christian König <ckoenig@posteo.de>
This commit is contained in:
Christian König 2023-12-09 22:01:30 +01:00
parent fe7299323c
commit 6d02d4056f
No known key found for this signature in database
2 changed files with 9 additions and 9 deletions

View file

@ -24,7 +24,7 @@ fi
getLocalVersion() { getLocalVersion() {
case ${1} in case ${1} in
"Pi-hole" ) echo "${CORE_VERSION:=N/A}";; "Pi-hole" ) echo "${CORE_VERSION:=N/A}";;
"web" ) echo "${WEB_VERSION:=N/A}";; "web" ) echo "${WEB_VERSION:=N/A}";;
"FTL" ) echo "${FTL_VERSION:=N/A}";; "FTL" ) echo "${FTL_VERSION:=N/A}";;
esac esac
} }
@ -32,7 +32,7 @@ getLocalVersion() {
getLocalHash() { getLocalHash() {
case ${1} in case ${1} in
"Pi-hole" ) echo "${CORE_HASH:=N/A}";; "Pi-hole" ) echo "${CORE_HASH:=N/A}";;
"web" ) echo "${WEB_HASH:=N/A}";; "web" ) echo "${WEB_HASH:=N/A}";;
"FTL" ) echo "${FTL_HASH:=N/A}";; "FTL" ) echo "${FTL_HASH:=N/A}";;
esac esac
} }
@ -40,7 +40,7 @@ getLocalHash() {
getRemoteHash(){ getRemoteHash(){
case ${1} in case ${1} in
"Pi-hole" ) echo "${GITHUB_CORE_HASH:=N/A}";; "Pi-hole" ) echo "${GITHUB_CORE_HASH:=N/A}";;
"web" ) echo "${GITHUB_WEB_HASH:=N/A}";; "web" ) echo "${GITHUB_WEB_HASH:=N/A}";;
"FTL" ) echo "${GITHUB_FTL_HASH:=N/A}";; "FTL" ) echo "${GITHUB_FTL_HASH:=N/A}";;
esac esac
} }
@ -48,7 +48,7 @@ getRemoteHash(){
getRemoteVersion(){ getRemoteVersion(){
case ${1} in case ${1} in
"Pi-hole" ) echo "${GITHUB_CORE_VERSION:=N/A}";; "Pi-hole" ) echo "${GITHUB_CORE_VERSION:=N/A}";;
"web" ) echo "${GITHUB_WEB_VERSION:=N/A}";; "web" ) echo "${GITHUB_WEB_VERSION:=N/A}";;
"FTL" ) echo "${GITHUB_FTL_VERSION:=N/A}";; "FTL" ) echo "${GITHUB_FTL_VERSION:=N/A}";;
esac esac
} }
@ -56,7 +56,7 @@ getRemoteVersion(){
getLocalBranch(){ getLocalBranch(){
case ${1} in case ${1} in
"Pi-hole" ) echo "${CORE_BRANCH:=N/A}";; "Pi-hole" ) echo "${CORE_BRANCH:=N/A}";;
"web" ) echo "${WEB_BRANCH:=N/A}";; "web" ) echo "${WEB_BRANCH:=N/A}";;
"FTL" ) echo "${FTL_BRANCH:=N/A}";; "FTL" ) echo "${FTL_BRANCH:=N/A}";;
esac esac
} }
@ -114,11 +114,11 @@ defaultOutput() {
helpFunc() { helpFunc() {
echo "Usage: pihole -v [repo | option] [option] echo "Usage: pihole -v [repo | option] [option]
Example: 'pihole -v -p -l' Example: 'pihole -v -p -l'
Show Pi-hole, Admin Console & FTL versions Show Pi-hole, Web Console & FTL versions
Repositories: Repositories:
-p, --pihole Only retrieve info regarding Pi-hole repository -p, --pihole Only retrieve info regarding Pi-hole repository
-a, --admin Only retrieve info regarding web repository -w, --web Only retrieve info regarding web repository
-f, --ftl Only retrieve info regarding FTL repository -f, --ftl Only retrieve info regarding FTL repository
Options: Options:
@ -131,7 +131,7 @@ Options:
case "${1}" in case "${1}" in
"-p" | "--pihole" ) shift; versionOutput "Pi-hole" "$@";; "-p" | "--pihole" ) shift; versionOutput "Pi-hole" "$@";;
"-a" | "--admin" ) shift; versionOutput "web" "$@";; "-w" | "--web" ) shift; versionOutput "web" "$@";;
"-f" | "--ftl" ) shift; versionOutput "FTL" "$@";; "-f" | "--ftl" ) shift; versionOutput "FTL" "$@";;
"-h" | "--help" ) helpFunc;; "-h" | "--help" ) helpFunc;;
* ) defaultOutput "$@";; * ) defaultOutput "$@";;

View file

@ -35,7 +35,7 @@ _pihole() {
COMPREPLY=( $(compgen -W "${opts_update}" -- ${cur}) ) COMPREPLY=( $(compgen -W "${opts_update}" -- ${cur}) )
;; ;;
"version") "version")
opts_version="\--admin \--current \--ftl \--hash \--latest \--pihole" opts_version="\--web \--current \--ftl \--hash \--latest \--pihole"
COMPREPLY=( $(compgen -W "${opts_version}" -- ${cur}) ) COMPREPLY=( $(compgen -W "${opts_version}" -- ${cur}) )
;; ;;
"core"|"admin"|"ftl") "core"|"admin"|"ftl")