Fix verdi export create when specifying computers #1448
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Fixes #1033
Only passing computers to
verdi export create
was not supported byexport
and hence broken.I added the necessary logic to make computers exportable.
Additionally, I fixed the parsing of the
verdi export create
command.Click does support multiple values for an option through the
multiple
keywordof the option constructor, however, this requires the user to repeat the flag
for each value, i.e.:
For big lists, this is impractical and untenable. Also it is not very intuitive and users were using it the way below, which would throw cryptic errors. Therefore we introduce a custom
MultiValueOption
that instead supports the following notation:Since these options are greedy, they can clash with cli commands that also take
arguments. If the greedy option is used, the argument will be mistaken for another
option value. In this case, the
MultiValueOption
respects the endopts marker '--'that is the standard for POSIX command line interfaces. Anything after this marker
will be considered as arguments by the parser.