diff options
Diffstat (limited to 'tests/cdash/cfg_gnu.py')
-rw-r--r-- | tests/cdash/cfg_gnu.py | 33 |
1 files changed, 25 insertions, 8 deletions
diff --git a/tests/cdash/cfg_gnu.py b/tests/cdash/cfg_gnu.py index 75f22d75..4a1362b6 100644 --- a/tests/cdash/cfg_gnu.py +++ b/tests/cdash/cfg_gnu.py @@ -23,19 +23,36 @@ import sys # Each configurator must export this function def create_builder(args): + usage = """\ +Usage: + main.py cfg_gnu [-h|--help] [cfg_site] + +Arguments: + cfg_site: site configuration module. If not specified, "cfg_site" + is implied + -h, --help Show this help screen + +""" # (optional) args format: # site configuration module. If not specified, "cfg_site" is implied - if len(args)>0: - file = args[0] - else: - file = "cfg_site" - - if os.access(file+".py", os.F_OK) == False: - print "Error: file '%s.py' doesn't exist." % (file) + cfg_site = "cfg_site" + + for arg in args: + if arg=="-h" or arg=="--help": + print usage + sys.exit(0) + elif arg[0]=="-": + print usage + sys.exit(1) + else: + cfg_site = arg + + if os.access(cfg_site+".py", os.F_OK) == False: + print "Error: file '%s.py' doesn't exist." % (cfg_site) sys.exit(1) - cfg_site = __import__(file) + cfg_site = __import__(cfg_site) test_cfg = builder.BaseConfig(cfg_site.BASE_DIR, \ cfg_site.URL, \ cfg_site.SITE_NAME, \ |