New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
add --avail-toolchain-opts #1830
Conversation
@@ -713,6 +715,10 @@ def _postprocess_list_avail(self): | |||
if self.options.list_toolchains: | |||
msg += list_toolchains(self.options.output_format) | |||
|
|||
# dump known toolchain options | |||
if self.options.avail_toolchain_opts: | |||
msg += avail_toolchain_opts(str(self.options.avail_toolchain_opts), self.options.output_format) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why str(...)
?
@Caylo please add a comment in the PR with how the output looks like (both with |
table_values = [ | ||
['``%s``' % opt_name for opt_name in tc_dict.keys()], | ||
['%s' % val[1] for val in tc_dict.values()], | ||
['``%s``' % val[0] for val in tc_dict.values()], |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
two more problems here: sorting, and you have no strict guarantee that .values()
will return things in the same key-order when being called twice
so, collect .items()
before, and sort by key, then build up table_values
"""Show list of known options for given toolchain.""" | ||
tc_class, _ = search_toolchain(name) | ||
if not tc_class: | ||
return "Couldn't find toolchain: '%s'. To see available toolchains, use --list-toolchains" % name |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
please use raise EasyBuildError
here (which will print to stderr and exit)
Going in, thanks @Caylo! |
see easybuilders/easybuild#66
eb --avail-toolchain opts intel
eb --avail-toolchain opts intel --output-format=rst