Use argName instead of optionName for module args

This commit is contained in:
T. R. Bernstein
2024-06-28 01:18:53 +02:00
committed by T. R. Bernstein
parent f568cc6dbd
commit 4d9805581c
2 changed files with 6 additions and 5 deletions

View File

@@ -27,17 +27,18 @@ function printModulesToInstall() {
} }
function generateModuleOptions() { function generateModuleOptions() {
local value answerKey optionKey local value answerKey optionKey argName
for answerKey in ${(k)moduleAnswers}; do for answerKey in ${(k)moduleAnswers}; do
[[ ${answerKey} = ${mod}_* ]] || continue [[ ${answerKey} = ${mod}_* ]] || continue
optionKey="${answerKey#${mod}_}" optionKey="${answerKey#${mod}_}"
argName=${optionKey//_/-};
value="${moduleAnswers[${answerKey}]}" value="${moduleAnswers[${answerKey}]}"
if [[ "${optionKey}" =~ ^[[:alpha:]]$ ]]; then if [[ "${optionKey}" =~ ^[[:alpha:]]$ ]]; then
moduleOptions+=("-${optionKey}" "${value}") moduleOptions+=("-${argName}" "${value}")
elif [[ "${optionKey}" =~ ^[[:alpha:]][-[:alpha:]]+$ ]]; then elif [[ "${optionKey}" =~ ^[[:alpha:]][-[:alpha:]]+$ ]]; then
moduleOptions+=("--${optionKey}" "${value}") moduleOptions+=("--${argName}" "${value}")
else else
moduleOptions+=("${optionKey}" "${value}") moduleOptions+=("${argName}" "${value}")
fi fi
done done
} }

2
zshlib

Submodule zshlib updated: e9b08647c5...46cbbc2d37