mirror of
https://github.com/MinecraftServerControl/mscs.git
synced 2024-11-15 14:58:18 -07:00
Move 'usage' info to a function
Improves eficiency avoiding to load the usage text in memory three times.
This commit is contained in:
parent
bc22934da5
commit
56aa1dc076
11
mscs
11
mscs
@ -48,7 +48,8 @@
|
||||
# Script Usage
|
||||
# ---------------------------------------------------------------------------
|
||||
|
||||
USAGE=$(cat <<EOF
|
||||
usage() {
|
||||
cat <<EOF
|
||||
Usage: $0 <option>
|
||||
|
||||
Options:
|
||||
@ -136,9 +137,9 @@ Options:
|
||||
update <world>
|
||||
Update the server software for the Minecraft world server. Update
|
||||
server software for all worlds by default.
|
||||
|
||||
EOF
|
||||
)
|
||||
}
|
||||
|
||||
|
||||
# Override Global Variables
|
||||
# ---------------------------------------------------------------------------
|
||||
@ -2346,12 +2347,12 @@ case "$1" in
|
||||
usage|help)
|
||||
printf "Minecraft Server Control Script\n"
|
||||
printf "\n"
|
||||
printf "$USAGE\n"
|
||||
usage
|
||||
;;
|
||||
*)
|
||||
printf "Error in command line usage.\n"
|
||||
printf "\n"
|
||||
printf "$USAGE\n"
|
||||
usage
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
|
Loading…
Reference in New Issue
Block a user