Skip to content
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

Shortcut for equal-separated option value pairs #703

Open
ghisvail opened this issue Sep 14, 2023 · 1 comment
Open

Shortcut for equal-separated option value pairs #703

ghisvail opened this issue Sep 14, 2023 · 1 comment
Labels
enhancement New feature or request

Comments

@ghisvail
Copy link
Collaborator

Certain CLI parsers, such as FSL's Eddy, implement a rigid formulation where only equal-separated options (--long-option=value) are accepted and space-separated ones (--long-option value) are rejected. Pydra implements space-separated options, which are common to short and long option names in modern standards.

Sadly, this complicates specification definition slightly with repetition:

class InputSpec(ShellSpec):
    input_image: PathLike = field(
        metadata={
            "help_string": "input image",
            "argstr": "--imain={input_image}",
        }
    )
    ...

There is a notion of separator in Pydra's field metadata, but it is used for lists of values.

Maybe we could introduce an option separator (defaults to whitespace if unspecified), such as:

class InputSpec(ShellSpec):
    input_image: PathLike = field(
        metadata={
            "help_string": "input image",
            "argstr": "--imain",
            "optsep": "=",
        }
    )
    ...
@ghisvail ghisvail added the enhancement New feature or request label Sep 14, 2023
@satra
Copy link
Contributor

satra commented Sep 14, 2023

Pydra implements space-separated options, which are common to short and long option names in modern standards.

pydra actually follows nipype in this perspective and allows various formulations.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants