Skip to content

CommandLine: replace from_str to something like (class method) #2647

@ZDu-IDM

Description

@ZDu-IDM
@classmethod
def from_args(cls, executable=None, *args, is_windows: bool = False, raw_args: List[Any] = None, **kwargs):
    """
    Custom factory to map *args to _args and **kwargs to _options
    """
    return cls(
        _executable=executable,
        _options=kwargs,                # capture **kwargs into dict
        _args=list(args),               # capture *args into list
        is_windows=is_windows,
        _raw_args=list(raw_args) if raw_args else []
    )

Note: above new method is fake and need to add more details.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions