mirror of
https://github.com/pi-hole/pi-hole
synced 2024-12-22 14:58:08 +00:00
Show help for "pihole -v -h"
* Indent output text * Minor help text change
This commit is contained in:
parent
4eb7d2868c
commit
3bd677c102
@ -104,7 +104,7 @@ versionOutput() {
|
||||
|
||||
[[ "$2" == "-c" ]] || [[ "$2" == "--current" ]] || [[ -z "$2" ]] && current=$(getLocalVersion $GITDIR)
|
||||
[[ "$2" == "-l" ]] || [[ "$2" == "--latest" ]] || [[ -z "$2" ]] && latest=$(getRemoteVersion "$1")
|
||||
if [[ "$2" == "-h" ]] || [[ "$2" == "--hash" ]]; then
|
||||
if [[ "$2" == "--hash" ]]; then
|
||||
[[ "$3" == "-c" ]] || [[ "$3" == "--current" ]] || [[ -z "$3" ]] && curHash=$(getLocalHash "$GITDIR")
|
||||
[[ "$3" == "-l" ]] || [[ "$3" == "--latest" ]] || [[ -z "$3" ]] && latHash=$(getRemoteHash "$1" "$(cd "$GITDIR" 2> /dev/null && git rev-parse --abbrev-ref HEAD)")
|
||||
fi
|
||||
@ -127,11 +127,11 @@ versionOutput() {
|
||||
errorOutput
|
||||
fi
|
||||
|
||||
[[ -n "$output" ]] && echo "$output"
|
||||
[[ -n "$output" ]] && echo " $output"
|
||||
}
|
||||
|
||||
errorOutput() {
|
||||
echo "Invalid Option! Try 'pihole -v -h' for more information."
|
||||
echo " Invalid Option! Try 'pihole -v -h' for more information."
|
||||
exit 1
|
||||
}
|
||||
|
||||
@ -142,7 +142,7 @@ defaultOutput() {
|
||||
}
|
||||
|
||||
helpFunc() {
|
||||
echo "Usage: pihole -v [REPO | OPTION] [OPTION]
|
||||
echo "Usage: pihole -v [repo | option] [option]
|
||||
Example: 'pihole -v -p -l'
|
||||
Show Pi-hole, Admin Console & FTL versions
|
||||
|
||||
@ -154,8 +154,8 @@ Repositories:
|
||||
Options:
|
||||
-c, --current Return the current version
|
||||
-l, --latest Return the latest version
|
||||
-h, --hash Return the Github hash from your local repositories
|
||||
--help Show this help dialog
|
||||
--hash Return the Github hash from your local repositories
|
||||
-h, --help Show this help dialog
|
||||
"
|
||||
exit 0
|
||||
}
|
||||
@ -164,6 +164,6 @@ case "${1}" in
|
||||
"-p" | "--pihole" ) shift; versionOutput "pi-hole" "$@";;
|
||||
"-a" | "--admin" ) shift; versionOutput "AdminLTE" "$@";;
|
||||
"-f" | "--ftl" ) shift; versionOutput "FTL" "$@";;
|
||||
"--help" ) helpFunc;;
|
||||
"-h" | "--help" ) helpFunc;;
|
||||
* ) defaultOutput "$@";;
|
||||
esac
|
||||
|
Loading…
Reference in New Issue
Block a user