Use argName instead of optionName for module args
This commit is contained in:
committed by
T. R. Bernstein
parent
f568cc6dbd
commit
4d9805581c
@@ -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
2
zshlib
Submodule zshlib updated: e9b08647c5...46cbbc2d37
Reference in New Issue
Block a user