Skip to content

Configuration should follow argument convention of run() #144

@cmcgee1024

Description

@cmcgee1024

Describe the bug
When constructing a Configuration for use with one of the two variants of the run() functions the executable is a named parameter.

Configuration(executable: .path("/bin/echo"))

In an equivalent run method invocation without a configuration the executable is a (first) positional required argument.

try await run(.path("/bin/echo"))

This is more ergonomic because it is usually very clear that run is running an executable and that is the first and highest precedent argument, so there isn't a need to label it. Plus, it is typed to help and avoid accidentally providing an argument in the place of the executable.

The Configuration constructor should behave the same way so that it can be invoked like this with only the one extra set of parentheses and type name to do the same thing:

try await run(Configuration(.path("/bin/echo")))

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions