bug-fix: fix potential variable scope leakage from function.

This commit is contained in:
2025-07-20 03:08:24 -07:00
parent 1010fb88b4
commit 46ba8de167

3
mc
View File

@@ -83,11 +83,14 @@ function usage() {
printf "Backup directory can be changed from default ~/mc-mc_backup/ by using 'export MY_MC_BACKUP_DIR=</path/to/dir/>'\n\n"
printf "Positional arguments will fill the JSON objects with values from left to right.\n\n"
printf "COMMANDS:\n"
local command
for command in "${!commands[@]}"; do
local endpoint method body
read -r endpoint method body <<<"${commands[${command}]}"
echo -e "\t ${command} ${body}" | sed 's/[":\{\}]//g' |sed 's/%s//g'| sed 's/[,]/ /g'
done
printf "\n"
}