diff options
author | Sol Jerome <solj@ices.utexas.edu> | 2008-09-12 21:25:16 +0000 |
---|---|---|
committer | Sol Jerome <solj@ices.utexas.edu> | 2008-09-12 21:25:16 +0000 |
commit | 01e56e153fd83c0b51760cf4ec04cc07e39bcc1b (patch) | |
tree | 8999bb657bb258d41d83244c0506c43956775512 /src/sbin | |
parent | cd78f764f64ea2984c6382a20b7ffd7d44345995 (diff) | |
download | bcfg2-01e56e153fd83c0b51760cf4ec04cc07e39bcc1b.tar.gz bcfg2-01e56e153fd83c0b51760cf4ec04cc07e39bcc1b.tar.bz2 bcfg2-01e56e153fd83c0b51760cf4ec04cc07e39bcc1b.zip |
Improve help messages for bcfg2-admin (and modes)
git-svn-id: https://svn.mcs.anl.gov/repos/bcfg/trunk/bcfg2@4910 ce84e21b-d406-0410-9b95-82705330c041
Diffstat (limited to 'src/sbin')
-rwxr-xr-x | src/sbin/bcfg2-admin | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/src/sbin/bcfg2-admin b/src/sbin/bcfg2-admin index 2a1fc233d..bf7296517 100755 --- a/src/sbin/bcfg2-admin +++ b/src/sbin/bcfg2-admin @@ -26,23 +26,23 @@ if __name__ == '__main__': raise SystemExit(1) - do_help = False # First get the options... for opt, arg in opts: - if opt in ("-h", "--help"): - do_help = True if opt in ("-C", "--configfile"): configfile = arg modes = [x.lower() for x in Bcfg2.Server.Admin.__all__] modes.remove('mode') - if do_help or len(args) < 1 or args[0] == 'help': + if len(args) < 1 or args[0] == 'help': + sys.stdout.write("Usage: bcfg2-admin MODE [ARGS]\n\n" + "Available modes are:") if len(args) > 1: args = [args[1], args[0]] else: - for mod in [mode_import(mode) for mode in modes]: - print mod.__shorthelp__ + for mode in modes: + sys.stdout.write("\n %-12s %s" % + (mode, mode_import(mode).__shorthelp__)) raise SystemExit(0) if args[0] in modes: modname = args[0].capitalize() |