Skip to content

Add CommandRegistry “main” with explicit arguments#33

Merged
mdiep merged 1 commit intoCarthage:swift-2.0from
natestedman:swift-2.0
Oct 19, 2015
Merged

Add CommandRegistry “main” with explicit arguments#33
mdiep merged 1 commit intoCarthage:swift-2.0from
natestedman:swift-2.0

Conversation

@natestedman
Copy link
Copy Markdown
Contributor

This adds:

@noreturn public func main(var arguments arguments: [String], defaultVerb: String, errorHandler: ClientError -> ())

In addition to the current:

@noreturn public func main(defaultVerb defaultVerb: String, errorHandler: ClientError -> ())

Which now just calls the new function with Process.arguments as the first parameter.

@mdiep
Copy link
Copy Markdown
Member

mdiep commented Oct 18, 2015

Is there a particular use case you have in mind for this?

@natestedman
Copy link
Copy Markdown
Contributor Author

As far as I can tell, Process.arguments is not populated (this is not the case for NSProcessInfo's arguments) if your main is written in Objective-C (or plain old C, I suppose) and your Swift code is in a framework. I can't find any actual documentation of this behavior, though.

@mdiep
Copy link
Copy Markdown
Member

mdiep commented Oct 19, 2015

👍

mdiep added a commit that referenced this pull request Oct 19, 2015
Add CommandRegistry “main” with explicit arguments
@mdiep mdiep merged commit 19c3e9f into Carthage:swift-2.0 Oct 19, 2015
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