bug-fix: fix potential variable scope leakage from function.
This commit is contained in:
3
mc
3
mc
@@ -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 "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 "Positional arguments will fill the JSON objects with values from left to right.\n\n"
|
||||||
printf "COMMANDS:\n"
|
printf "COMMANDS:\n"
|
||||||
|
|
||||||
|
local command
|
||||||
for command in "${!commands[@]}"; do
|
for command in "${!commands[@]}"; do
|
||||||
local endpoint method body
|
local endpoint method body
|
||||||
read -r endpoint method body <<<"${commands[${command}]}"
|
read -r endpoint method body <<<"${commands[${command}]}"
|
||||||
echo -e "\t ${command} ${body}" | sed 's/[":\{\}]//g' |sed 's/%s//g'| sed 's/[,]/ /g'
|
echo -e "\t ${command} ${body}" | sed 's/[":\{\}]//g' |sed 's/%s//g'| sed 's/[,]/ /g'
|
||||||
done
|
done
|
||||||
|
|
||||||
printf "\n"
|
printf "\n"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user