mrcat: Change positional argument structure#2792
Conversation
No longer enforce the presence of at least two input images during command-line parsing; instead defer this to the run() function.
|
clang-tidy review says "All clean, LGTM! 👍" |
|
After further consideration in the context of Pydra workflow construction, it's possible that changing the |
jdtournier
left a comment
There was a problem hiding this comment.
Fully agree with these changes. Not sure why we'd implemented it that way in the first place, in hindsight...
Personally, I don't think this should even raise a warning. There's nothing theoretically wrong with passing a single input image to |
Conflicts: cmd/mrcat.cpp
|
clang-tidy review says "All clean, LGTM! 👍" |
Currently,
mrcatenforces at the point of command-line parsing that there are at least two input images. It does this by havingArgumentimage, thenArgumentimage2with.allow_multiple().I have two issues with this design:
Consider Implement Pydra code-generators #2665. Ideally, the utilisation of
mrcatin a Pydra workflow would look something like:However with an automatically-generated Pydra interface, what would actually be required
would end up being a rather clunky:
This mechanism is absent from other commands where it is equally applicable; eg.
mraverageheader,transformcompose. So the software is not internally consistent in this regard.For the first point in particular, I think it makes sense to have a single positional input argument with
.allow_multiple(). But I am open to a counter-argument.Hypothetically, we could introduce some other
Argumentmodifier that would set the minimum number of occurrences. This would allow catching command mis-use at the point of command-line parsing. But we would then need to consider how to reflect this information in the various__print_usage__interface exports. Any thoughts?