From: Simon Glass <sjg@chromium.org>
Date: Sat, 6 Sep 2014 01:00:11 +0000 (-0600)
Subject: buildman: Move full help code into the control module
X-Git-Tag: v2025.01-rc5-pxa1908~14702^2~15
X-Git-Url: http://git.dujemihanovic.xyz/%22http:/kyber.dk/phpMyBuilder/static/%7B%7B%20%28.OutputFormats.Get?a=commitdiff_plain;h=48ba5856eb47dca0abc4d24e7c4e3ce1fd2628f1;p=u-boot.git

buildman: Move full help code into the control module

There is no good reason to keep this code separate. Move it into control.py
so it is easier to test.

Signed-off-by: Simon Glass <sjg@chromium.org>
---

diff --git a/tools/buildman/buildman.py b/tools/buildman/buildman.py
index c4de857d99..70c2142901 100755
--- a/tools/buildman/buildman.py
+++ b/tools/buildman/buildman.py
@@ -63,12 +63,6 @@ options, args = cmdline.ParseArgs()
 # Run our meagre tests
 if options.test:
     RunTests()
-elif options.full_help:
-    pager = os.getenv('PAGER')
-    if not pager:
-        pager = 'more'
-    fname = os.path.join(os.path.dirname(sys.argv[0]), 'README')
-    command.Run(pager, fname)
 
 # Build selected commits for selected boards
 else:
diff --git a/tools/buildman/control.py b/tools/buildman/control.py
index 06c9229fba..408d9b126b 100644
--- a/tools/buildman/control.py
+++ b/tools/buildman/control.py
@@ -84,6 +84,14 @@ def DoBuildman(options, args):
         options: Command line options object
         args: Command line arguments (list of strings)
     """
+    if options.full_help:
+        pager = os.getenv('PAGER')
+        if not pager:
+            pager = 'more'
+        fname = os.path.join(os.path.dirname(sys.argv[0]), 'README')
+        command.Run(pager, fname)
+        return 0
+
     gitutil.Setup()
 
     bsettings.Setup(options.config_file)