diff options
Diffstat (limited to 'src/sbin')
-rwxr-xr-x | src/sbin/bcfg2-admin | 6 | ||||
-rwxr-xr-x | src/sbin/bcfg2-info | 13 |
2 files changed, 12 insertions, 7 deletions
diff --git a/src/sbin/bcfg2-admin b/src/sbin/bcfg2-admin index 09117a3f4..386c8dd47 100755 --- a/src/sbin/bcfg2-admin +++ b/src/sbin/bcfg2-admin @@ -44,6 +44,9 @@ def main(): 'verbose': Bcfg2.Options.VERBOSE, } setup = Bcfg2.Options.OptionParser(optinfo) + # override default help message to include description of all modes + setup.hm = "Usage:\n %s\n%s" % (setup.buildHelpMessage(), + create_description()) setup.parse(sys.argv[1:]) log_args = dict(to_syslog=False, to_console=logging.WARNING) @@ -58,8 +61,7 @@ def main(): setup['args'] = [setup['args'][1], setup['args'][0]] else: # Print short help for all modes - print("Usage:\n %s" % setup.buildHelpMessage()) - print(create_description()) + print(setup.hm) raise SystemExit(0) if setup['args'][0] in get_modes(): diff --git a/src/sbin/bcfg2-info b/src/sbin/bcfg2-info index 4412c712a..c73efa23e 100755 --- a/src/sbin/bcfg2-info +++ b/src/sbin/bcfg2-info @@ -103,11 +103,11 @@ def displayTrace(trace, num=80, sort=('time', 'calls')): class infoCore(cmd.Cmd, Bcfg2.Server.Core.Core): """Main class for bcfg2-info.""" - def __init__(self, repo, plgs, passwd, encoding, event_debug): + def __init__(self, repo, plgs, passwd, encoding, event_debug, filemonitor='default'): cmd.Cmd.__init__(self) try: Bcfg2.Server.Core.Core.__init__(self, repo, plgs, passwd, - encoding) + encoding, filemonitor=filemonitor) if event_debug: self.fam.debug = True except Bcfg2.Server.Core.CoreInitError: @@ -518,20 +518,23 @@ if __name__ == '__main__': 'logging': Bcfg2.Options.LOGGING_FILE_PATH }) setup = Bcfg2.Options.OptionParser(optinfo) + setup.hm = "Usage:\n %s\n%s" % (setup.buildHelpMessage(), + USAGE) + setup.parse(sys.argv[1:]) if setup['args'] and setup['args'][0] == 'help': - print(USAGE) + print(setup.hm) sys.exit(0) elif setup['profile'] and have_profile: prof = profile.Profile() loop = prof.runcall(infoCore, setup['repo'], setup['plugins'], setup['password'], setup['encoding'], - setup['event debug']) + setup['event debug'], setup['filemonitor']) displayTrace(prof) else: if setup['profile']: print("Profiling functionality not available.") loop = infoCore(setup['repo'], setup['plugins'], setup['password'], - setup['encoding'], setup['event debug']) + setup['encoding'], setup['event debug'], setup['filemonitor']) loop.Run(setup['args']) |