Beispiel #1
0
    def config_options(self):
        # config options
        descr = ("Configuration options", "Configure EasyBuild behavior.")

        oldstyle_defaults = get_default_oldstyle_configfile_defaults()

        opts = {
                "config":("Path to EasyBuild config file",
                          None, 'store', oldstyle_defaults['config'], "C",),
                'prefix': (('Change prefix for buildpath, installpath, sourcepath and repositorypath '
                            '(repositorypath prefix is only relevant in case of FileRepository repository)'
                            '(used prefix for defaults %s)' % oldstyle_defaults['prefix']),
                               None, 'store', None),
                'buildpath': ('Temporary build path',
                               None, 'store', oldstyle_defaults['buildpath']),
                'installpath':  ('Final install path',
                                  None, 'store', oldstyle_defaults['installpath']),
                'subdir-modules': ('Subdir in installpath for modules',
                                           None, 'store', oldstyle_defaults['subdir_modules']),
                'subdir-software': ('Subdir in installpath for software',
                                            None, 'store', oldstyle_defaults['subdir_software']),
                'repository': ('Repository type, using repositorypath',
                                'choice', 'store', oldstyle_defaults['repository'],
                                sorted(avail_repositories().keys())),
                'repositorypath': (('Repository path, used by repository '
                                    '(is passed as list of arguments to create the repository instance). '
                                    'For more info, use --avail-repositories.'),
                                    'strlist', 'store',
                                    oldstyle_defaults['repositorypath'][oldstyle_defaults['repository']]),
                "avail-repositories":("Show all repository types (incl. non-usable)",
                                      None, "store_true", False,),
                'logfile-format': ('Directory name and format of the log file ',
                              'strtuple', 'store', oldstyle_defaults['logfile_format'], {'metavar': 'DIR,FORMAT'}),
                'tmp-logdir': ('Log directory where temporary log files are stored',
                            None, 'store', oldstyle_defaults['tmp_logdir']),
                'sourcepath': ('Path(s) to where sources should be downloaded (string, colon-separated)',
                               None, 'store', oldstyle_defaults['sourcepath']),
                'moduleclasses': (('Extend supported module classes'
                                   ' (For more info on the default classes, use --show-default-moduleclasses)'),
                                  None, 'extend', oldstyle_defaults['moduleclasses']),
                'show-default-moduleclasses': ('Show default module classes with description',
                                               None, 'store_true', False),
                'modules-tool': ('Modules tool to use',
                                 'choice', 'store', oldstyle_defaults['modules_tool'],
                                 sorted(avail_modules_tools().keys())),
                "avail-modules-tools":("Show all supported module tools",
                                       None, "store_true", False,),
                'module-naming-scheme': ('Module naming scheme', 'choice', 'store',
                                         oldstyle_defaults['module_naming_scheme'],
                                         sorted(avail_module_naming_schemes().keys())),
                "avail-module-naming-schemes":("Show all supported module naming schemes",
                                               None, "store_true", False,),
                # this one is sort of an exception, it's something jobscripts can set,
                #  has no real meaning for regular eb usage
                "testoutput": ("Path to where a job should place the output (to be set within jobscript)",
                               None, "store", None),
                }

        self.log.debug("config_options: descr %s opts %s" % (descr, opts))
        self.add_group_parser(opts, descr)
Beispiel #2
0
    def config_options(self):
        # config options
        descr = ("Configuration options", "Configure EasyBuild behavior.")

        opts = OrderedDict({
            'avail-module-naming-schemes': ("Show all supported module naming schemes",
                                            None, 'store_true', False,),
            'avail-modules-tools': ("Show all supported module tools",
                                    None, "store_true", False,),
            'avail-repositories': ("Show all repository types (incl. non-usable)",
                                    None, "store_true", False,),
            'buildpath': ("Temporary build path", None, 'store', mk_full_default_path('buildpath')),
            'ignore-dirs': ("Directory names to ignore when searching for files/dirs",
                            'strlist', 'store', ['.git', '.svn']),
            'installpath': ("Install path for software and modules", None, 'store', mk_full_default_path('installpath')),
            'config': ("Path to EasyBuild config file (DEPRECATED, use --configfiles instead!)",
                       None, 'store', get_default_oldstyle_configfile(), 'C'),
            # purposely take a copy for the default logfile format
            'logfile-format': ("Directory name and format of the log file",
                               'strtuple', 'store', DEFAULT_LOGFILE_FORMAT[:], {'metavar': 'DIR,FORMAT'}),
            'module-naming-scheme': ("Module naming scheme",
                                     'choice', 'store', DEFAULT_MNS, sorted(avail_module_naming_schemes().keys())),
            'moduleclasses': (("Extend supported module classes "
                               "(For more info on the default classes, use --show-default-moduleclasses)"),
                               None, 'extend', [x[0] for x in DEFAULT_MODULECLASSES]),
            'modules-footer': ("Path to file containing footer to be added to all generated module files",
                               None, 'store_or_None', None, {'metavar': "PATH"}),
            'modules-tool': ("Modules tool to use",
                             'choice', 'store', DEFAULT_MODULES_TOOL, sorted(avail_modules_tools().keys())),
            'prefix': (("Change prefix for buildpath, installpath, sourcepath and repositorypath "
                        "(used prefix for defaults %s)" % DEFAULT_PREFIX),
                        None, 'store', None),
            'recursive-module-unload': ("Enable generating of modules that unload recursively.",
                                        None, 'store_true', False),
            'repository': ("Repository type, using repositorypath",
                           'choice', 'store', DEFAULT_REPOSITORY, sorted(avail_repositories().keys())),
            'repositorypath': (("Repository path, used by repository "
                                "(is passed as list of arguments to create the repository instance). "
                                "For more info, use --avail-repositories."),
                                'strlist', 'store',
                                [mk_full_default_path('repositorypath')]),
            'show-default-moduleclasses': ("Show default module classes with description",
                                           None, 'store_true', False),
            'sourcepath': ("Path(s) to where sources should be downloaded (string, colon-separated)",
                           None, 'store', mk_full_default_path('sourcepath')),
            'subdir-modules': ("Installpath subdir for modules", None, 'store', DEFAULT_PATH_SUBDIRS['subdir_modules']),
            'subdir-software': ("Installpath subdir for software", None, 'store', DEFAULT_PATH_SUBDIRS['subdir_software']),
            'suffix-modules-path': ("Suffix for module files install path", None, 'store', GENERAL_CLASS),
            # this one is sort of an exception, it's something jobscripts can set,
            # has no real meaning for regular eb usage
            'testoutput': ("Path to where a job should place the output (to be set within jobscript)",
                            None, 'store', None),
            'tmp-logdir': ("Log directory where temporary log files are stored",
                           None, 'store', DEFAULT_TMP_LOGDIR),
            'tmpdir': ('Directory to use for temporary storage', None, 'store', None),
        })

        self.log.debug("config_options: descr %s opts %s" % (descr, opts))
        self.add_group_parser(opts, descr)
Beispiel #3
0
    def _postprocess_list_avail(self):
        """Create all the additional info that can be requested (exit at the end)"""
        msg = ''

        # dump supported configuration file constants
        if self.options.avail_cfgfile_constants:
            msg += self.avail_cfgfile_constants()

        # dump possible easyconfig params
        if self.options.avail_easyconfig_params:
            msg += avail_easyconfig_params(
                self.options.easyblock, self.options.avail_easyconfig_params)

        # dump easyconfig template options
        if self.options.avail_easyconfig_templates:
            msg += template_documentation()

        # dump easyconfig constant options
        if self.options.avail_easyconfig_constants:
            msg += constant_documentation()

        # dump easyconfig license options
        if self.options.avail_easyconfig_licenses:
            msg += license_documentation()

        # dump available easyblocks
        if self.options.list_easyblocks:
            msg += self.avail_easyblocks()

        # dump known toolchains
        if self.options.list_toolchains:
            msg += self.avail_toolchains()

        # dump known repository types
        if self.options.avail_repositories:
            msg += self.avail_repositories()

        # dump supported modules tools
        if self.options.avail_modules_tools:
            msg += self.avail_list('modules tools', avail_modules_tools())

        # dump supported module naming schemes
        if self.options.avail_module_naming_schemes:
            msg += self.avail_list('module naming schemes',
                                   avail_module_naming_schemes())

        # dump default list of config files that are considered
        if self.options.show_default_configfiles:
            msg += self.show_default_configfiles()

        # dump default moduleclasses with description
        if self.options.show_default_moduleclasses:
            msg += self.show_default_moduleclasses()

        if self.options.unittest_file:
            self.log.info(msg)
        else:
            print msg
        sys.exit(0)
Beispiel #4
0
    def _postprocess_list_avail(self):
        """Create all the additional info that can be requested (exit at the end)"""
        msg = ""

        # dump supported configuration file constants
        if self.options.avail_cfgfile_constants:
            msg += self.avail_cfgfile_constants()

        # dump possible easyconfig params
        if self.options.avail_easyconfig_params:
            msg += avail_easyconfig_params(self.options.easyblock, self.options.avail_easyconfig_params)

        # dump easyconfig template options
        if self.options.avail_easyconfig_templates:
            msg += template_documentation()

        # dump easyconfig constant options
        if self.options.avail_easyconfig_constants:
            msg += constant_documentation()

        # dump easyconfig license options
        if self.options.avail_easyconfig_licenses:
            msg += license_documentation()

        # dump available easyblocks
        if self.options.list_easyblocks:
            msg += self.avail_easyblocks()

        # dump known toolchains
        if self.options.list_toolchains:
            msg += self.avail_toolchains()

        # dump known repository types
        if self.options.avail_repositories:
            msg += self.avail_repositories()

        # dump supported modules tools
        if self.options.avail_modules_tools:
            msg += self.avail_list("modules tools", avail_modules_tools())

        # dump supported module naming schemes
        if self.options.avail_module_naming_schemes:
            msg += self.avail_list("module naming schemes", avail_module_naming_schemes())

        # dump default list of config files that are considered
        if self.options.show_default_configfiles:
            msg += self.show_default_configfiles()

        # dump default moduleclasses with description
        if self.options.show_default_moduleclasses:
            msg += self.show_default_moduleclasses()

        if self.options.unittest_file:
            self.log.info(msg)
        else:
            print msg
        sys.exit(0)
Beispiel #5
0
    def config_options(self):
        # config options
        descr = ("Configuration options", "Configure EasyBuild behavior.")

        opts = OrderedDict(
            {
                "avail-module-naming-schemes": ("Show all supported module naming schemes", None, "store_true", False),
                "avail-modules-tools": ("Show all supported module tools", None, "store_true", False),
                "avail-repositories": ("Show all repository types (incl. non-usable)", None, "store_true", False),
                "buildpath": ("Temporary build path", None, "store", mk_full_default_path("buildpath")),
                "external-modules-metadata": (
                    "List of files specifying metadata for external modules (INI format)",
                    "strlist",
                    "store",
                    [],
                ),
                "ignore-dirs": (
                    "Directory names to ignore when searching for files/dirs",
                    "strlist",
                    "store",
                    [".git", ".svn"],
                ),
                "installpath": (
                    "Install path for software and modules",
                    None,
                    "store",
                    mk_full_default_path("installpath"),
                ),
                "installpath-modules": (
                    "Install path for modules (if None, combine --installpath and --subdir-modules)",
                    None,
                    "store",
                    None,
                ),
                "installpath-software": (
                    "Install path for software (if None, combine --installpath and --subdir-software)",
                    None,
                    "store",
                    None,
                ),
                # purposely take a copy for the default logfile format
                "logfile-format": (
                    "Directory name and format of the log file",
                    "strtuple",
                    "store",
                    DEFAULT_LOGFILE_FORMAT[:],
                    {"metavar": "DIR,FORMAT"},
                ),
                "module-naming-scheme": (
                    "Module naming scheme",
                    "choice",
                    "store",
                    DEFAULT_MNS,
                    sorted(avail_module_naming_schemes().keys()),
                ),
                "module-syntax": (
                    "Syntax to be used for module files",
                    "choice",
                    "store",
                    DEFAULT_MODULE_SYNTAX,
                    sorted(avail_module_generators().keys()),
                ),
                "moduleclasses": (
                    (
                        "Extend supported module classes "
                        "(For more info on the default classes, use --show-default-moduleclasses)"
                    ),
                    None,
                    "extend",
                    [x[0] for x in DEFAULT_MODULECLASSES],
                ),
                "modules-footer": (
                    "Path to file containing footer to be added to all generated module files",
                    None,
                    "store_or_None",
                    None,
                    {"metavar": "PATH"},
                ),
                "modules-tool": (
                    "Modules tool to use",
                    "choice",
                    "store",
                    DEFAULT_MODULES_TOOL,
                    sorted(avail_modules_tools().keys()),
                ),
                "prefix": (
                    (
                        "Change prefix for buildpath, installpath, sourcepath and repositorypath "
                        "(used prefix for defaults %s)" % DEFAULT_PREFIX
                    ),
                    None,
                    "store",
                    None,
                ),
                "recursive-module-unload": (
                    "Enable generating of modules that unload recursively.",
                    None,
                    "store_true",
                    False,
                ),
                "repository": (
                    "Repository type, using repositorypath",
                    "choice",
                    "store",
                    DEFAULT_REPOSITORY,
                    sorted(avail_repositories().keys()),
                ),
                "repositorypath": (
                    (
                        "Repository path, used by repository "
                        "(is passed as list of arguments to create the repository instance). "
                        "For more info, use --avail-repositories."
                    ),
                    "strlist",
                    "store",
                    self.default_repositorypath,
                ),
                "sourcepath": (
                    "Path(s) to where sources should be downloaded (string, colon-separated)",
                    None,
                    "store",
                    mk_full_default_path("sourcepath"),
                ),
                "subdir-modules": (
                    "Installpath subdir for modules",
                    None,
                    "store",
                    DEFAULT_PATH_SUBDIRS["subdir_modules"],
                ),
                "subdir-software": (
                    "Installpath subdir for software",
                    None,
                    "store",
                    DEFAULT_PATH_SUBDIRS["subdir_software"],
                ),
                "suffix-modules-path": ("Suffix for module files install path", None, "store", GENERAL_CLASS),
                # this one is sort of an exception, it's something jobscripts can set,
                # has no real meaning for regular eb usage
                "testoutput": (
                    "Path to where a job should place the output (to be set within jobscript)",
                    None,
                    "store",
                    None,
                ),
                "tmp-logdir": ("Log directory where temporary log files are stored", None, "store", None),
                "tmpdir": ("Directory to use for temporary storage", None, "store", None),
            }
        )

        self.log.debug("config_options: descr %s opts %s" % (descr, opts))
        self.add_group_parser(opts, descr)
    def config_options(self):
        # config options
        descr = ("Configuration options", "Configure EasyBuild behavior.")

        oldstyle_defaults = get_default_oldstyle_configfile_defaults()

        opts = OrderedDict(
            {
                "avail-module-naming-schemes": ("Show all supported module naming schemes", None, "store_true", False),
                "avail-modules-tools": ("Show all supported module tools", None, "store_true", False),
                "avail-repositories": ("Show all repository types (incl. non-usable)", None, "store_true", False),
                "buildpath": ("Temporary build path", None, "store", oldstyle_defaults["buildpath"]),
                "ignore-dirs": (
                    "Directory names to ignore when searching for files/dirs",
                    "strlist",
                    "store",
                    [".git", ".svn"],
                ),
                "installpath": (
                    "Install path for software and modules",
                    None,
                    "store",
                    oldstyle_defaults["installpath"],
                ),
                "config": ("Path to EasyBuild config file", None, "store", oldstyle_defaults["config"], "C"),
                "logfile-format": (
                    "Directory name and format of the log file",
                    "strtuple",
                    "store",
                    oldstyle_defaults["logfile_format"],
                    {"metavar": "DIR,FORMAT"},
                ),
                "module-naming-scheme": (
                    "Module naming scheme",
                    "choice",
                    "store",
                    oldstyle_defaults["module_naming_scheme"],
                    sorted(avail_module_naming_schemes().keys()),
                ),
                "moduleclasses": (
                    (
                        "Extend supported module classes "
                        "(For more info on the default classes, use --show-default-moduleclasses)"
                    ),
                    None,
                    "extend",
                    oldstyle_defaults["moduleclasses"],
                ),
                "modules-footer": (
                    "Path to file containing footer to be added to all generated module files",
                    None,
                    "store_or_None",
                    None,
                    {"metavar": "PATH"},
                ),
                "modules-tool": (
                    "Modules tool to use",
                    "choice",
                    "store",
                    oldstyle_defaults["modules_tool"],
                    sorted(avail_modules_tools().keys()),
                ),
                "prefix": (
                    (
                        "Change prefix for buildpath, installpath, sourcepath and repositorypath "
                        "(repositorypath prefix is only relevant in case of FileRepository repository) "
                        "(used prefix for defaults %s)" % oldstyle_defaults["prefix"]
                    ),
                    None,
                    "store",
                    None,
                ),
                "recursive-module-unload": (
                    "Enable generating of modules that unload recursively.",
                    None,
                    "store_true",
                    False,
                ),
                "repository": (
                    "Repository type, using repositorypath",
                    "choice",
                    "store",
                    oldstyle_defaults["repository"],
                    sorted(avail_repositories().keys()),
                ),
                "repositorypath": (
                    (
                        "Repository path, used by repository "
                        "(is passed as list of arguments to create the repository instance). "
                        "For more info, use --avail-repositories."
                    ),
                    "strlist",
                    "store",
                    oldstyle_defaults["repositorypath"][oldstyle_defaults["repository"]],
                ),
                "show-default-moduleclasses": (
                    "Show default module classes with description",
                    None,
                    "store_true",
                    False,
                ),
                "sourcepath": (
                    "Path(s) to where sources should be downloaded (string, colon-separated)",
                    None,
                    "store",
                    oldstyle_defaults["sourcepath"],
                ),
                "subdir-modules": (
                    "Installpath subdir for modules",
                    None,
                    "store",
                    oldstyle_defaults["subdir_modules"],
                ),
                "subdir-software": (
                    "Installpath subdir for software",
                    None,
                    "store",
                    oldstyle_defaults["subdir_software"],
                ),
                # this one is sort of an exception, it's something jobscripts can set,
                # has no real meaning for regular eb usage
                "testoutput": (
                    "Path to where a job should place the output (to be set within jobscript)",
                    None,
                    "store",
                    None,
                ),
                "tmp-logdir": (
                    "Log directory where temporary log files are stored",
                    None,
                    "store",
                    oldstyle_defaults["tmp_logdir"],
                ),
                "tmpdir": ("Directory to use for temporary storage", None, "store", None),
            }
        )

        self.log.debug("config_options: descr %s opts %s" % (descr, opts))
        self.add_group_parser(opts, descr)
    def config_options(self):
        # config options
        descr = ("Configuration options", "Configure EasyBuild behavior.")

        oldstyle_defaults = get_default_oldstyle_configfile_defaults()

        opts = OrderedDict({
            'avail-module-naming-schemes': ("Show all supported module naming schemes",
                                            None, 'store_true', False,),
            'avail-modules-tools': ("Show all supported module tools",
                                    None, "store_true", False,),
            'avail-repositories': ("Show all repository types (incl. non-usable)",
                                    None, "store_true", False,),
            'buildpath': ("Temporary build path", None, 'store', oldstyle_defaults['buildpath']),
            'ignore-dirs': ("Directory names to ignore when searching for files/dirs",
                            'strlist', 'store', ['.git', '.svn']),
            'installpath': ("Install path for software and modules", None, 'store', oldstyle_defaults['installpath']),
            'config': ("Path to EasyBuild config file",
                       None, 'store', oldstyle_defaults['config'], 'C'),
            'logfile-format': ("Directory name and format of the log file",
                               'strtuple', 'store', oldstyle_defaults['logfile_format'], {'metavar': 'DIR,FORMAT'}),
            'module-naming-scheme': ("Module naming scheme",
                                     'choice', 'store', oldstyle_defaults['module_naming_scheme'],
                                     sorted(avail_module_naming_schemes().keys())),
            'moduleclasses': (("Extend supported module classes "
                               "(For more info on the default classes, use --show-default-moduleclasses)"),
                               None, 'extend', oldstyle_defaults['moduleclasses']),
            'modules-footer': ("Path to file containing footer to be added to all generated module files",
                               None, 'store_or_None', None, {'metavar': "PATH"}),
            'modules-tool': ("Modules tool to use",
                             'choice', 'store', oldstyle_defaults['modules_tool'],
                             sorted(avail_modules_tools().keys())),
            'prefix': (("Change prefix for buildpath, installpath, sourcepath and repositorypath "
                        "(repositorypath prefix is only relevant in case of FileRepository repository) "
                        "(used prefix for defaults %s)" % oldstyle_defaults['prefix']),
                        None, 'store', None),
            'recursive-module-unload': ("Enable generating of modules that unload recursively.",
                                        None, 'store_true', False),
            'repository': ("Repository type, using repositorypath",
                           'choice', 'store', oldstyle_defaults['repository'], sorted(avail_repositories().keys())),
            'repositorypath': (("Repository path, used by repository "
                                "(is passed as list of arguments to create the repository instance). "
                                "For more info, use --avail-repositories."),
                                'strlist', 'store',
                                oldstyle_defaults['repositorypath'][oldstyle_defaults['repository']]),
            'show-default-moduleclasses': ("Show default module classes with description",
                                           None, 'store_true', False),
            'sourcepath': ("Path(s) to where sources should be downloaded (string, colon-separated)",
                           None, 'store', oldstyle_defaults['sourcepath']),
            'subdir-modules': ("Installpath subdir for modules", None, 'store', oldstyle_defaults['subdir_modules']),
            'subdir-software': ("Installpath subdir for software", None, 'store', oldstyle_defaults['subdir_software']),
            # this one is sort of an exception, it's something jobscripts can set,
            # has no real meaning for regular eb usage
            'testoutput': ("Path to where a job should place the output (to be set within jobscript)",
                            None, 'store', None),
            'tmp-logdir': ("Log directory where temporary log files are stored",
                           None, 'store', oldstyle_defaults['tmp_logdir']),
            'tmpdir': ('Directory to use for temporary storage', None, 'store', None),
        })

        self.log.debug("config_options: descr %s opts %s" % (descr, opts))
        self.add_group_parser(opts, descr)
    def config_options(self):
        # config options
        descr = ("Configuration options", "Configure EasyBuild behavior.")

        opts = OrderedDict({
            'avail-module-naming-schemes': (
                "Show all supported module naming schemes",
                None,
                'store_true',
                False,
            ),
            'avail-modules-tools': (
                "Show all supported module tools",
                None,
                "store_true",
                False,
            ),
            'avail-repositories': (
                "Show all repository types (incl. non-usable)",
                None,
                "store_true",
                False,
            ),
            'buildpath': ("Temporary build path", None, 'store',
                          mk_full_default_path('buildpath')),
            'ignore-dirs':
            ("Directory names to ignore when searching for files/dirs",
             'strlist', 'store', ['.git', '.svn']),
            'installpath': ("Install path for software and modules", None,
                            'store', mk_full_default_path('installpath')),
            # purposely take a copy for the default logfile format
            'logfile-format':
            ("Directory name and format of the log file", 'strtuple', 'store',
             DEFAULT_LOGFILE_FORMAT[:], {
                 'metavar': 'DIR,FORMAT'
             }),
            'module-naming-scheme':
            ("Module naming scheme", 'choice', 'store', DEFAULT_MNS,
             sorted(avail_module_naming_schemes().keys())),
            'moduleclasses':
            (("Extend supported module classes "
              "(For more info on the default classes, use --show-default-moduleclasses)"
              ), None, 'extend', [x[0] for x in DEFAULT_MODULECLASSES]),
            'modules-footer':
            ("Path to file containing footer to be added to all generated module files",
             None, 'store_or_None', None, {
                 'metavar': "PATH"
             }),
            'modules-tool': ("Modules tool to use", 'choice', 'store',
                             DEFAULT_MODULES_TOOL,
                             sorted(avail_modules_tools().keys())),
            'prefix':
            (("Change prefix for buildpath, installpath, sourcepath and repositorypath "
              "(used prefix for defaults %s)" % DEFAULT_PREFIX), None, 'store',
             None),
            'recursive-module-unload':
            ("Enable generating of modules that unload recursively.", None,
             'store_true', False),
            'repository': ("Repository type, using repositorypath", 'choice',
                           'store', DEFAULT_REPOSITORY,
                           sorted(avail_repositories().keys())),
            'repositorypath':
            (("Repository path, used by repository "
              "(is passed as list of arguments to create the repository instance). "
              "For more info, use --avail-repositories."), 'strlist', 'store',
             [mk_full_default_path('repositorypath')]),
            'show-default-moduleclasses':
            ("Show default module classes with description", None,
             'store_true', False),
            'sourcepath':
            ("Path(s) to where sources should be downloaded (string, colon-separated)",
             None, 'store', mk_full_default_path('sourcepath')),
            'subdir-modules': ("Installpath subdir for modules", None, 'store',
                               DEFAULT_PATH_SUBDIRS['subdir_modules']),
            'subdir-software': ("Installpath subdir for software", None,
                                'store',
                                DEFAULT_PATH_SUBDIRS['subdir_software']),
            'suffix-modules-path': ("Suffix for module files install path",
                                    None, 'store', GENERAL_CLASS),
            # this one is sort of an exception, it's something jobscripts can set,
            # has no real meaning for regular eb usage
            'testoutput':
            ("Path to where a job should place the output (to be set within jobscript)",
             None, 'store', None),
            'tmp-logdir':
            ("Log directory where temporary log files are stored", None,
             'store', None),
            'tmpdir': ('Directory to use for temporary storage', None, 'store',
                       None),
        })

        self.log.debug("config_options: descr %s opts %s" % (descr, opts))
        self.add_group_parser(opts, descr)
    def _postprocess_list_avail(self):
        """Create all the additional info that can be requested (exit at the end)"""
        msg = ''

        # dump supported configuration file constants
        if self.options.avail_cfgfile_constants:
            msg += self.avail_cfgfile_constants()

        # dump possible easyconfig params
        if self.options.avail_easyconfig_params:
            msg += avail_easyconfig_params(self.options.easyblock, self.options.avail_easyconfig_params)

        # dump easyconfig template options
        if self.options.avail_easyconfig_templates:
            msg += template_documentation()

        # dump easyconfig constant options
        if self.options.avail_easyconfig_constants:
            msg += constant_documentation()

        # dump easyconfig license options
        if self.options.avail_easyconfig_licenses:
            msg += license_documentation()

        # dump available easyblocks
        if self.options.list_easyblocks:
            msg += self.avail_easyblocks()

        # dump known toolchains
        if self.options.list_toolchains:
            msg += self.avail_toolchains()

        # dump known repository types
        if self.options.avail_repositories:
            msg += self.avail_repositories()

        # dump supported modules tools
        if self.options.avail_modules_tools:
            msg += self.avail_list('modules tools', avail_modules_tools())

        # dump supported module naming schemes
        if self.options.avail_module_naming_schemes:
            msg += self.avail_list('module naming schemes', avail_module_naming_schemes())

        # dump default list of config files that are considered
        if self.options.show_default_configfiles:
            msg += self.show_default_configfiles()

        # dump default moduleclasses with description
        if self.options.show_default_moduleclasses:
            msg += self.show_default_moduleclasses()

        if self.options.unittest_file:
            self.log.info(msg)
        else:
            print msg

        # cleanup tmpdir
        try:
            shutil.rmtree(self.tmpdir)
        except OSError as err:
            raise EasyBuildError("Failed to clean up temporary directory %s: %s", self.tmpdir, err)

        sys.exit(0)
    def config_options(self):
        # config options
        descr = ("Configuration options", "Configure EasyBuild behavior.")

        opts = OrderedDict({
            'avail-module-naming-schemes': ("Show all supported module naming schemes",
                                            None, 'store_true', False,),
            'avail-modules-tools': ("Show all supported module tools",
                                    None, "store_true", False,),
            'avail-repositories': ("Show all repository types (incl. non-usable)",
                                   None, "store_true", False,),
            'buildpath': ("Temporary build path", None, 'store', mk_full_default_path('buildpath')),
            'external-modules-metadata': ("List of files specifying metadata for external modules (INI format)",
                                          'strlist', 'store', []),
            'ignore-dirs': ("Directory names to ignore when searching for files/dirs",
                            'strlist', 'store', ['.git', '.svn']),
            'include-easyblocks': ("Location(s) of extra or customized easyblocks", 'strlist', 'store', []),
            'include-module-naming-schemes': ("Location(s) of extra or customized module naming schemes",
                                              'strlist', 'store', []),
            'include-toolchains': ("Location(s) of extra or customized toolchains or toolchain components",
                                   'strlist', 'store', []),
            'installpath': ("Install path for software and modules",
                            None, 'store', mk_full_default_path('installpath')),
            'installpath-modules': ("Install path for modules (if None, combine --installpath and --subdir-modules)",
                                    None, 'store', None),
            'installpath-software': ("Install path for software (if None, combine --installpath and --subdir-software)",
                                     None, 'store', None),
            'job-backend': ("Backend to use for submitting jobs", 'choice', 'store',
                            DEFAULT_JOB_BACKEND, sorted(avail_job_backends().keys())),
            # purposely take a copy for the default logfile format
            'logfile-format': ("Directory name and format of the log file",
                               'strtuple', 'store', DEFAULT_LOGFILE_FORMAT[:], {'metavar': 'DIR,FORMAT'}),
            'module-naming-scheme': ("Module naming scheme",
                                     'choice', 'store', DEFAULT_MNS, sorted(avail_module_naming_schemes().keys())),
            'module-syntax': ("Syntax to be used for module files", 'choice', 'store', DEFAULT_MODULE_SYNTAX,
                              sorted(avail_module_generators().keys())),
            'moduleclasses': (("Extend supported module classes "
                               "(For more info on the default classes, use --show-default-moduleclasses)"),
                              None, 'extend', [x[0] for x in DEFAULT_MODULECLASSES]),
            'modules-footer': ("Path to file containing footer to be added to all generated module files",
                               None, 'store_or_None', None, {'metavar': "PATH"}),
            'modules-tool': ("Modules tool to use",
                             'choice', 'store', DEFAULT_MODULES_TOOL, sorted(avail_modules_tools().keys())),
            'packagepath': ("The destination path for the packages built by package-tool",
                             None, 'store', mk_full_default_path('packagepath')),
            'package-naming-scheme': ("Packaging naming scheme choice", 
                                      'choice', 'store', DEFAULT_PNS, sorted(avail_package_naming_schemes().keys())),
            'prefix': (("Change prefix for buildpath, installpath, sourcepath and repositorypath "
                        "(used prefix for defaults %s)" % DEFAULT_PREFIX),
                       None, 'store', None),
            'recursive-module-unload': ("Enable generating of modules that unload recursively.",
                                        None, 'store_true', False),
            'repository': ("Repository type, using repositorypath",
                           'choice', 'store', DEFAULT_REPOSITORY, sorted(avail_repositories().keys())),
            'repositorypath': (("Repository path, used by repository "
                                "(is passed as list of arguments to create the repository instance). "
                                "For more info, use --avail-repositories."),
                               'strlist', 'store', self.default_repositorypath),
            'sourcepath': ("Path(s) to where sources should be downloaded (string, colon-separated)",
                           None, 'store', mk_full_default_path('sourcepath')),
            'subdir-modules': ("Installpath subdir for modules", None, 'store', DEFAULT_PATH_SUBDIRS['subdir_modules']),
            'subdir-software': ("Installpath subdir for software",
                                None, 'store', DEFAULT_PATH_SUBDIRS['subdir_software']),
            'suffix-modules-path': ("Suffix for module files install path", None, 'store', GENERAL_CLASS),
            # this one is sort of an exception, it's something jobscripts can set,
            # has no real meaning for regular eb usage
            'testoutput': ("Path to where a job should place the output (to be set within jobscript)",
                           None, 'store', None),
            'tmp-logdir': ("Log directory where temporary log files are stored", None, 'store', None),
            'tmpdir': ('Directory to use for temporary storage', None, 'store', None),
        })

        self.log.debug("config_options: descr %s opts %s" % (descr, opts))
        self.add_group_parser(opts, descr)