Fix verdi export create when specifying computers#1448
Merged
sphuber merged 2 commits intoApr 20, 2018
Conversation
giovannipizzi
approved these changes
Apr 19, 2018
…ption
Click does support multiple values for an option through the `multiple` keyword
of the option constructor, however, this requires the user to repeat the flag
for each value, i.e.:
--nodes 1 --nodes 2 --nodes 15
For big lists, this is impractical and untenable. Therefore we introduce a custom
MultiValueOption that instead supports the following notation:
--nodes 1 2 15
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.
9b26f63 to
cb01893
Compare
Codecov Report
@@ Coverage Diff @@
## workflows #1448 +/- ##
=============================================
+ Coverage 56.45% 56.51% +0.06%
=============================================
Files 270 270
Lines 33517 33568 +51
=============================================
+ Hits 18922 18971 +49
- Misses 14595 14597 +2
Continue to review full report at Codecov.
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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 createwas not supported byexportand hence broken.I added the necessary logic to make computers exportable.
Additionally, I fixed the parsing of the
verdi export createcommand.Click does support multiple values for an option through the
multiplekeywordof 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
MultiValueOptionthat 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
MultiValueOptionrespects the endopts marker '--'that is the standard for POSIX command line interfaces. Anything after this marker
will be considered as arguments by the parser.