SCons options display hack: Fix ListVariable to generate comma separated (quoted if required) list of allowed names

git-svn-id: https://svn.code.sf.net/p/nsis/code/NSIS/trunk@6212 212acab6-be3b-0410-9dea-997c60f758d6
This commit is contained in:
anders_k 2011-12-15 23:35:40 +00:00
parent b3dc58c704
commit 6cf12d3c83

View file

@ -107,6 +107,17 @@ SConscript('SCons/config.py')
opts.Update(defenv)
Help(opts.GenerateHelpText(defenv))
#Fix ListVariable to generate comma separated (quoted if required) list of allowed names:
org_ListVariable = ListVariable
def ListVariable(key, help, default, names, map={}):
r = list(org_ListVariable(key, help, default, names, map))
if len(r) == 5 and isinstance(r[1], str):
fmt = 'allowed names: %s'
repl = fmt % ', '.join( ((' ' in s) and ('"%s"' % s) or s) for s in names )
r[1] = r[1].replace(fmt % ' '.join(names), repl)
return r
install_dirs = {
'relocatable': {
'dest': '',