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() {
|
||||
local value answerKey optionKey
|
||||
local value answerKey optionKey argName
|
||||
for answerKey in ${(k)moduleAnswers}; do
|
||||
[[ ${answerKey} = ${mod}_* ]] || continue
|
||||
optionKey="${answerKey#${mod}_}"
|
||||
argName=${optionKey//_/-};
|
||||
value="${moduleAnswers[${answerKey}]}"
|
||||
if [[ "${optionKey}" =~ ^[[:alpha:]]$ ]]; then
|
||||
moduleOptions+=("-${optionKey}" "${value}")
|
||||
moduleOptions+=("-${argName}" "${value}")
|
||||
elif [[ "${optionKey}" =~ ^[[:alpha:]][-[:alpha:]]+$ ]]; then
|
||||
moduleOptions+=("--${optionKey}" "${value}")
|
||||
moduleOptions+=("--${argName}" "${value}")
|
||||
else
|
||||
moduleOptions+=("${optionKey}" "${value}")
|
||||
moduleOptions+=("${argName}" "${value}")
|
||||
fi
|
||||
done
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user