Daniel Gibbs hai 1 ano
pai
achega
8feb4b2fb5
Modificáronse 1 ficheiros con 11 adicións e 11 borrados
  1. 11 11
      lgsm/modules/core_getopt.sh

+ 11 - 11
lgsm/modules/core_getopt.sh

@@ -158,27 +158,27 @@ currentopt+=("${cmd_sponsor[@]}")
 optcommands=()
 index="0"
 for ((index = "0"; index < ${#currentopt[@]}; index += 3)); do
-	cmdamount=$(echo -e "${currentopt[index]}" | awk -F ';' '{ print NF }')
+	cmdamount=$(fn_print_nl "${currentopt[index]}" | awk -F ';' '{ print NF }')
 	for ((cmdindex = 1; cmdindex <= cmdamount; cmdindex++)); do
-		optcommands+=("$(echo -e "${currentopt[index]}" | awk -F ';' -v x=${cmdindex} '{ print $x }')")
+		optcommands+=("$(fn_print_nl "${currentopt[index]}" | awk -F ';' -v x=${cmdindex} '{ print $x }')")
 	done
 done
 
 # Shows LinuxGSM usage.
 fn_opt_usage() {
-	echo -e "Usage: $0 [option]"
-	echo -e ""
-	echo -e "LinuxGSM - ${gamename} - Version ${version}"
-	echo -e "https://linuxgsm.com/${gameservername}"
-	echo -e ""
-	echo -e "${bold}${lightyellow}Commands${default}"
+	fn_print_nl "Usage: $0 [option]"
+	fn_print_nl ""
+	fn_print_nl "LinuxGSM - ${gamename} - Version ${version}"
+	fn_print_nl "https://linuxgsm.com/${gameservername}"
+	fn_print_nl ""
+	fn_print_nl "${bold}${lightyellow}Commands${default}"
 	# Display available commands.
 	index="0"
 	{
 		for ((index = "0"; index < ${#currentopt[@]}; index += 3)); do
 			# Hide developer commands.
 			if [ "${currentopt[index + 2]}" != "DEVCOMMAND" ]; then
-				echo -e "${cyan}$(echo -e "${currentopt[index]}" | awk -F ';' '{ print $2 }')\t${default}$(echo -e "${currentopt[index]}" | awk -F ';' '{ print $1 }')\t| ${currentopt[index + 2]}"
+				fn_print_nl "${cyan}$(fn_print_nl "${currentopt[index]}" | awk -F ';' '{ print $2 }')\t${default}$(fn_print_nl "${currentopt[index]}" | awk -F ';' '{ print $1 }')\t| ${currentopt[index + 2]}"
 			fi
 		done
 	} | column -s $'\t' -t
@@ -196,9 +196,9 @@ for i in "${optcommands[@]}"; do
 		# Seek and run command.
 		index="0"
 		for ((index = "0"; index < ${#currentopt[@]}; index += 3)); do
-			currcmdamount=$(echo -e "${currentopt[index]}" | awk -F ';' '{ print NF }')
+			currcmdamount=$(fn_print_nl "${currentopt[index]}" | awk -F ';' '{ print NF }')
 			for ((currcmdindex = 1; currcmdindex <= currcmdamount; currcmdindex++)); do
-				if [ "$(echo -e "${currentopt[index]}" | awk -F ';' -v x=${currcmdindex} '{ print $x }')" == "${getopt}" ]; then
+				if [ "$(fn_print_nl "${currentopt[index]}" | awk -F ';' -v x=${currcmdindex} '{ print $x }')" == "${getopt}" ]; then
 					# Run command.
 					eval "${currentopt[index + 1]}"
 					# Exit should occur in modules. Should this not happen print an error