diff --git a/easybuild/tools/options.py b/easybuild/tools/options.py index 128ff8561b..cda2794a28 100644 --- a/easybuild/tools/options.py +++ b/easybuild/tools/options.py @@ -120,6 +120,12 @@ def terminal_supports_colors(stream): return False +# alternative names for EasyBuild configuration options; +# format: '': '' +ALTERNATIVE_EASYBUILD_CONFIGURATION_OPTIONS = { + 'build-path': 'buildpath', +} + CONFIG_ENV_VAR_PREFIX = 'EASYBUILD' XDG_CONFIG_HOME = os.environ.get('XDG_CONFIG_HOME', os.path.join(os.path.expanduser('~'), ".config")) @@ -207,6 +213,18 @@ def use_color(colorize, stream=sys.stdout): return False +def add_alternate_options(opts): + """ + Add alternative names to provided dictionary of configuration options + """ + rev_map_alt_cfg_opts = {v: k for k, v in ALTERNATIVE_EASYBUILD_CONFIGURATION_OPTIONS.items()} + for key in rev_map_alt_cfg_opts: + if key in opts: + alt_key = rev_map_alt_cfg_opts[key] + alt_descr = opts[key][0] + f" (alternative for --{key})" + opts[alt_key] = (alt_descr,) + opts[key][1:] + + class EasyBuildOptions(GeneralOption): """Easybuild generaloption class""" VERSION = this_is_easybuild() @@ -550,7 +568,7 @@ def config_options(self): 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')), + 'buildpath': ("Path for temporary build directories", None, 'store', mk_full_default_path('buildpath')), 'containerpath': ("Location where container recipe & image will be stored", None, 'store', mk_full_default_path('containerpath')), 'envvars-user-modules': ("List of environment variables that hold the base paths for which user-specific " @@ -625,6 +643,8 @@ def config_options(self): 'tmpdir': ('Directory to use for temporary storage', None, 'store', None), }) + add_alternate_options(opts) + self.log.debug("config_options: descr %s opts %s" % (descr, opts)) self.add_group_parser(opts, descr)