summaryrefslogtreecommitdiffstats
path: root/src/engine/SCons/Script/__init__.py
diff options
context:
space:
mode:
authorWilliam Roberts <bill.c.roberts@gmail.com>2015-03-17 21:26:53 (GMT)
committerWilliam Roberts <bill.c.roberts@gmail.com>2015-03-17 21:26:53 (GMT)
commit7e15cea215477c4eb495be1e8459e7eacd02b235 (patch)
tree027da5593a1558eccd324a75597c272990632297 /src/engine/SCons/Script/__init__.py
parentb6c7bd73535753a45dec87e8bb3b8584443d40dd (diff)
downloadSCons-7e15cea215477c4eb495be1e8459e7eacd02b235.zip
SCons-7e15cea215477c4eb495be1e8459e7eacd02b235.tar.gz
SCons-7e15cea215477c4eb495be1e8459e7eacd02b235.tar.bz2
bug 2831: Allow appending Help text to Options Output
http://scons.tigris.org/issues/show_bug.cgi?id=2831 In order to append, rather than clobber Help() generated text, use Help("my message", append=True) The append argument is only respected on the first call to this method as it operates on global data.
Diffstat (limited to 'src/engine/SCons/Script/__init__.py')
-rw-r--r--src/engine/SCons/Script/__init__.py15
1 files changed, 12 insertions, 3 deletions
diff --git a/src/engine/SCons/Script/__init__.py b/src/engine/SCons/Script/__init__.py
index bb7b632..a9d7708 100644
--- a/src/engine/SCons/Script/__init__.py
+++ b/src/engine/SCons/Script/__init__.py
@@ -41,6 +41,7 @@ start_time = time.time()
import collections
import os
+import StringIO
import sys
# Special chicken-and-egg handling of the "--debug=memoizer" flag:
@@ -107,6 +108,7 @@ QuestionTask = Main.QuestionTask
#SConscriptSettableOptions = Main.SConscriptSettableOptions
AddOption = Main.AddOption
+PrintHelp = Main.PrintHelp
GetOption = Main.GetOption
SetOption = Main.SetOption
Progress = Main.Progress
@@ -258,10 +260,17 @@ def _Set_Default_Targets(env, tlist):
#
help_text = None
-def HelpFunction(text):
+def HelpFunction(text, append=False):
global help_text
- if SCons.Script.help_text is None:
- SCons.Script.help_text = text
+ if help_text is None:
+ if append:
+ s = StringIO.StringIO()
+ PrintHelp(s)
+ help_text = s.getvalue()
+ s.close()
+ else:
+ help_text = ""
+ help_text = help_text + "\nLocal Build Variables:\n" + text
else:
help_text = help_text + text