diff options
author | Joel Andres Granados <jgranado@redhat.com> | 2008-03-18 19:09:50 +0100 |
---|---|---|
committer | Joel Andres Granados <jgranado@redhat.com> | 2008-03-18 19:09:50 +0100 |
commit | 577dbf83603321be92897f7c2aa123b7544e2300 (patch) | |
tree | bab30b5fb1c12ff5b3608f646e3b34af16c86f0f /firstaidkit | |
parent | 3f5c4b3ed824516745e85b5f8954763bc75f1883 (diff) | |
download | firstaidkit-577dbf83603321be92897f7c2aa123b7544e2300.tar.gz firstaidkit-577dbf83603321be92897f7c2aa123b7544e2300.tar.xz firstaidkit-577dbf83603321be92897f7c2aa123b7544e2300.zip |
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.
Diffstat (limited to 'firstaidkit')
-rwxr-xr-x | firstaidkit | 21 |
1 files changed, 10 insertions, 11 deletions
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. |