[PATCH 1/2] Return CLI help text at once
Martin Kolman
mkolman at redhat.com
Wed May 7 15:09:19 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.
Signed-off-by: Martin Kolman <mkolman at redhat.com>
---
anaconda | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/anaconda b/anaconda
index a16a385..23f5c69 100755
--- a/anaconda
+++ b/anaconda
@@ -744,6 +744,12 @@ 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
+ import sys
+ 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.0
More information about the anaconda-patches
mailing list