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

[CommandRegistry] Return self from register(_:) for method chaining #111

Merged
merged 2 commits into from
Aug 14, 2017

Conversation

ikesyo
Copy link
Member

@ikesyo ikesyo commented Aug 14, 2017

registry
    .register(FooCommand())
    .register(BarCommand())
    .register(BazCommand())

```swift
registry
    .register(FooCommand())
    .register(BarCommand())
    .register(BazCommand())
```
@mdiep
Copy link
Member

mdiep commented Aug 14, 2017

Would it make more sense to accept an array of commands instead?

registry.register(
    FooCommand(),
    BarCommand(),
    BazCommand()
)

@ikesyo
Copy link
Member Author

ikesyo commented Aug 14, 2017

Sounds good, so how about this?

registry
    .register(FooCommand(), BarCommand(), BazCommand())
    .main(defaultVerb: ...) { ... }

@mdiep mdiep merged commit ab80aa4 into master Aug 14, 2017
@mdiep mdiep deleted the chain-register branch August 14, 2017 15:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants