From d808bca48f6494feab4d1dedc321798e785a41e6 Mon Sep 17 00:00:00 2001 From: Piero Toffanin Date: Mon, 7 Dec 2020 08:51:26 -0500 Subject: [PATCH] Fix help choices string parsing in options --- libs/odmInfo.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/libs/odmInfo.js b/libs/odmInfo.js index b7e61bf..8f5db7d 100644 --- a/libs/odmInfo.js +++ b/libs/odmInfo.js @@ -140,8 +140,10 @@ module.exports = { // is in the list of choices if (domain.indexOf(value) === -1) domain.unshift(value); } + + const choicesStr = Array.isArray(domain) ? domain.join(", ") : domain; - help = help.replace(/^One of: \%\(choices\)s. /, ""); + help = help.replace(/\%\(choices\)s/g, choicesStr); help = help.replace(/\%\(default\)s/g, value); odmOptions.push({