tests.append((t, settings.DESCRIPTION)) except Exception as e: logger.exception(str(e)) return tests def __call__(self, parser, namespace, values, option_string=None): tests = self.get_tests(namespace) logger.info('Available tests:') max_len = max([len(t[0]) for t in tests]) for t, desc in tests: desc = desc.replace("\n", "\n" + " " * (max_len + 6)) logger.info(" %-" + str(max_len) + "s : %s", t, desc) sys.exit(0) parser = ArgParser(description='The FLExible Network Tester.') parser.add_argument( "args", nargs="*", type=unicode, metavar="host|test|input_file", help="Hostname, test name or input filenames.") parser.add_argument( "-o", "--output", action="store", type=unicode, dest="OUTPUT", default="-", help="File to write processed output to (default standard out).") parser.add_argument( "-D", "--data-dir", action="store", type=unicode, dest="DATA_DIR", help="Directory to store data files in. Defaults to the current directory.")