[PATCH 02/14] Return CLI help text at once

Martin Kolman mkolman at redhat.com
Thu Aug 21 20:10:23 UTC 2014


If the CLI option help is requested with the --help or -h switch,
return the help text as quickly as possible and without unrelated
output.
Previously Anaconda took a couple of seconds to respond and the user
was greeted by unrelated status and error messages.

(cherry picked from commit 137ec27d15f172eb78a284aa4be31e4649f45c5f)

Related: rhbz:#1088459
Signed-off-by: Martin Kolman <mkolman at redhat.com>
---
 anaconda | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/anaconda b/anaconda
index f0d8f8b..bd5f5cd 100755
--- a/anaconda
+++ b/anaconda
@@ -678,6 +678,11 @@ def cleanPStore():
     dir_tree_map("/sys/fs/pstore", os.unlink, files=True, dirs=False)
 
 if __name__ == "__main__":
+    # check if the CLI help is requested and return it at once,
+    # without importing random stuff and spamming stdout
+    if ("--help" in sys.argv) or ("-h" in sys.argv):
+        parseOptions()
+
     print "Starting installer, one moment..."
 
     # Allow a file to be loaded as early as possible
-- 
1.9.3



More information about the anaconda-patches mailing list