Added help option -h.

This commit is contained in:
Storm Dragon 2020-09-05 00:26:29 -04:00
parent 15ec1bcb92
commit 829ad08a7b

View File

@ -57,6 +57,15 @@ checklist() {
exit 0
}
help() {
echo -e "Usage:\n"
echo "With no arguments, open the game launcher."
for i in "${!command[@]}" ; do
echo "-${i}: ${command[${i}]}"
done | sort
exit 0
}
install_wine_bottle() {
local bottle="${game,,}"
bottle="${bottle//[[:space:]]/-}"
@ -249,17 +258,21 @@ if [[ $# -eq 0 ]]; then
fi
# Array of command line arguments
command=(
"c" # Check wine environment
"i" # Install games
"m" # Manually handle install screens
"r" # Remove a game
declare -A command=(
[c]="Check your system for necessary components."
[h]="This help screen."
[i]="Install games."
[m]="Manually handle install screens instead of using xdotools."
[r]="Remove a game. This will delete all game data."
)
while getopts "${command[*]//[[:space:]]/}" i ; do
# Convert the keys of the associative array to a format usable by getopts
args="${!command[*]}"
args="${args//[[:space:]]/}"
while getopts "${args}" i ; do
case "$i" in
c) checklist;;
h) show_help;;
h) help;;
i) game_installer;;
m) manualInstall="true";;
r) game_removal;;