From 577dbf83603321be92897f7c2aa123b7544e2300 Mon Sep 17 00:00:00 2001 From: Joel Andres Granados Date: Tue, 18 Mar 2008 19:09:50 +0100 Subject: Have the help and print config first in line. Since these two are not modes are operation and exit after executing, they should be first so that an error messages is not showed in the output. --- firstaidkit | 21 ++++++++++----------- 1 file changed, 10 insertions(+), 11 deletions(-) (limited to 'firstaidkit') diff --git a/firstaidkit b/firstaidkit index 69d0888..f554245 100755 --- a/firstaidkit +++ b/firstaidkit @@ -160,12 +160,21 @@ if __name__=="__main__": Config.operation.mode = "info" Config.operation.params = val + if Flags.main_help: + usage(sys.argv[0]) + sys.exit(1) + + if Flags.print_config: + print 76*"-" + Config.write(sys.stdout) + print 76*"-" + sys.exit(0) + if Config.operation.mode == "flow": if len(rest) < 1: print "Error in the command arguments.\n" usage(sys.argv[0]) sys.exit(1) - Config.operation.plugin = rest[0] if len(rest)<=1: Config.operation.mode = "plugin" @@ -183,16 +192,6 @@ if __name__=="__main__": usage(sys.argv[0]) sys.exit(1) - if Flags.main_help: - usage(sys.argv[0]) - sys.exit(1) - - if Flags.print_config: - print 76*"-" - Config.write(sys.stdout) - print 76*"-" - sys.exit(0) - Config.lock() # Now that the config is locked, initialize log for plugin system. -- cgit