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

Added support for passing command line arguments #193

Merged
merged 1 commit into from
Jul 28, 2015
Merged

Added support for passing command line arguments #193

merged 1 commit into from
Jul 28, 2015

Conversation

EliasC
Copy link
Contributor

@EliasC EliasC commented Jul 24, 2015

The main method in Main may now have a single argument of type
[string]. This array contains the strings of argv that were passed
to the underlying C-program. Note that there is no need to pass argc
since encore arrays store their length. main may still have an empty
argument list.

Here is an example program that prints its argument list:

class Main
  def main(argv : [string]) : void
    repeat i <- |argv|
      print argv[i]

@albertnetymk
Copy link
Contributor

Trailing space is introduced in a few places. Other than that, I feel this PR is OK.

The `main` method in `Main` may now have a single argument of type
`[string]`. This array contains the strings of `argv` that were passed
to the underlying C-program. Note that there is no need to pass `argc`
since encore arrays store their length. `main` may still have an empty
argument list.

Here is an example program that prints its argument list:

```
class Main
  def main(argv : [string]) : void
    repeat i <- |argv|
      print argv[i]
```
@EliasC
Copy link
Contributor Author

EliasC commented Jul 28, 2015

Trailing space removed.

albertnetymk added a commit that referenced this pull request Jul 28, 2015
Added support for passing command line arguments
@albertnetymk albertnetymk merged commit 373c02b into parapluu:master Jul 28, 2015
@EliasC EliasC deleted the features/argv branch July 28, 2015 14:25
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